aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-04-07 15:26:43 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-04-07 15:26:43 +0200
commit762fe68abf22c6849ce8a01214a4e91ca8d4f9fc (patch)
tree63e7f017f32a7c00a6af5c8e1d88b0f569a1ce41
parentInitialization of Flask-Migrate. (diff)
downloadnewspipe-762fe68abf22c6849ce8a01214a4e91ca8d4f9fc.tar.gz
newspipe-762fe68abf22c6849ce8a01214a4e91ca8d4f9fc.tar.bz2
newspipe-762fe68abf22c6849ce8a01214a4e91ca8d4f9fc.zip
catch potential errors during creation of the first admin user.
-rwxr-xr-xnewspipe/commands.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/newspipe/commands.py b/newspipe/commands.py
index 3d7becdd..c58c66ae 100755
--- a/newspipe/commands.py
+++ b/newspipe/commands.py
@@ -45,7 +45,10 @@ def create_admin(nickname, password):
"pwdhash": generate_password_hash(password),
}
with application.app_context():
- UserController(ignore_context=True).create(**admin)
+ try:
+ UserController(ignore_context=True).create(**admin)
+ except Exception as e:
+ print(e)
@application.cli.command("fetch_asyncio")
bgstack15