Possibility to upload new user accounts to user table

From the users section it is possible to download all user records to a csv. Would it also be possible to upload user records from a csv and assigning initial passwords to these new users?

1 Like

Yes, I’ve done exactly that several times

1 Like

Yes, you can do this yourself quite easily.

You could mash together some parts of this old example app, and this function:

import bcrypt

def change_user_pass(user_table_row, new_password):
  user_pw_hash = bcrypt.hashpw(new_password.encode(), bcrypt.gensalt())
  user_table_row['password_hash'] = user_pw_hash.decode('utf-8')
  

The example app is way more code than you need, you could probably just get away with a page with an upload button that takes your csv and then sends it to the server module to process.

2 Likes

Hi Owen and Ian,
Thanks very much for this solution.
Warm regards,
Wim