3.5. maintenance_script module

Maintenance script for managing users, resetting passwords and generating password hashes.

Run ‘./maintenance_script.py’ to see the help message.

maintenance_script.create_user(db_session: Session, username: str, email: str, password: str)[source]

Create a new user with the given username, email and password.

maintenance_script.delete_user(db_session: Session, username: str)[source]

Delete the user with the given username.

maintenance_script.reset_password(db_session: Session, username: str, new_password: str)[source]

Reset the password of the user with the given username.

maintenance_script.set_user_admin_state(db_session: Session, username: str, is_admin: bool)[source]

Promote a user to become admin or demote an admin to become a normal user.

Parameters:

is_admin – whether the user should be promoted to admin (True) or demoted to user (False)