diff options
author | Frederick Muriuki Muriithi | 2023-05-30 12:39:54 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-05-30 12:39:54 +0300 |
commit | 0ade65915a247c4ae151e83850ab2be341d6815e (patch) | |
tree | c83c2465ba2b320c8a4cd956155dc4ea988c0c2a /main.py | |
parent | 0b0da1783bc701e74a1972869bdb221a3c9a6b2a (diff) | |
download | genenetwork3-0ade65915a247c4ae151e83850ab2be341d6815e.tar.gz |
Enable registering sys-admin on CLI
To ease registration of system-admin user, provide a CLI script to register
the user and mark them as sys admin in one go.
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -15,6 +15,7 @@ from gn3.auth.authentication.users import hash_password from gn3.auth import db +from scripts import register_sys_admin as rsysadm# type: ignore[import] from scripts import migrate_existing_data as med# type: ignore[import] app = create_app() @@ -115,6 +116,11 @@ def make_data_public(): """Make existing data that is not assigned to any group publicly visible.""" med.entry(app.config["AUTH_DB"], app.config["SQL_URI"]) +@app.cli.command() +def register_admin(): + """Register the administrator.""" + rsysadm.register_admin(app.config["AUTH_DB"]) + ##### END: CLI Commands ##### if __name__ == '__main__': |