add user creation using shell
This commit is contained in:
parent
078e06622a
commit
99f3638309
19
app.py
19
app.py
@ -288,5 +288,24 @@ def setup():
|
||||
print('application setup done')
|
||||
|
||||
|
||||
@application.cli.command("create_user")
|
||||
def shell_create_user():
|
||||
name = input("User login: ")
|
||||
email = input("User email: ")
|
||||
while True:
|
||||
password1 = getpass(prompt='Password: ')
|
||||
password2 = getpass(prompt='Retype your password: ')
|
||||
if password1 == password2:
|
||||
break
|
||||
print("The passwords dont match")
|
||||
create_user(
|
||||
name=name,
|
||||
password=password1,
|
||||
email=email,
|
||||
is_admin=False
|
||||
)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
application.run(debug=True)
|
||||
|
Loading…
Reference in New Issue
Block a user