diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-12-03 17:50:29 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-12-03 17:50:29 +0000 |
| commit | 3657e4c9b05d02c6a9fe7cad7d0e70c7642ec024 (patch) | |
| tree | d8c21a78978494e4a223fa760698ea9ae3b2dce8 | |
| parent | add the flask_app variable to the env (diff) | |
| download | AnnotateChange-3657e4c9b05d02c6a9fe7cad7d0e70c7642ec024.tar.gz AnnotateChange-3657e4c9b05d02c6a9fe7cad7d0e70c7642ec024.zip | |
add option to automatically confirm the admin email
| -rw-r--r-- | app/cli.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -4,6 +4,7 @@ # License: See LICENSE file # Copyright: 2020 (c) The Alan Turing Institute +import click import getpass from email_validator import validate_email @@ -18,7 +19,8 @@ def register(app): pass @admin.command() - def add(): + @click.option("--auto-confirm-email", is_flag=True) + def add(auto_confirm_email): username = input("Enter username: ") email = input("Enter email address: ") password = getpass.getpass() @@ -30,7 +32,12 @@ def register(app): validate_email(email) - user = User(username=username, email=email, is_admin=True) + user = User( + username=username, + email=email, + is_admin=True, + is_confirmed=auto_confirm_email, + ) user.set_password(password) db.session.add(user) db.session.commit() |
