aboutsummaryrefslogtreecommitdiff
path: root/src/manager.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2019-05-11 22:34:51 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2019-05-11 22:34:51 +0200
commit75b8f2230065ccedcc602b054305d08d0e450b8b (patch)
tree5563a09c69da096a4d19083637589af84a8b7068 /src/manager.py
parentUpdated README. (diff)
parentfix: edition of user's password was broken (diff)
downloadnewspipe-75b8f2230065ccedcc602b054305d08d0e450b8b.tar.gz
newspipe-75b8f2230065ccedcc602b054305d08d0e450b8b.tar.bz2
newspipe-75b8f2230065ccedcc602b054305d08d0e450b8b.zip
Merge branch 'master' of gitlab.com:newspipe/newspipe
Diffstat (limited to 'src/manager.py')
-rwxr-xr-xsrc/manager.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/manager.py b/src/manager.py
index c088ac29..795b3974 100755
--- a/src/manager.py
+++ b/src/manager.py
@@ -38,6 +38,14 @@ def db_create():
db.create_all()
UserController(ignore_context=True).create(**admin)
+@manager.command
+def create_admin(nickname, password):
+ "Will create an admin user."
+ admin = {'is_admin': True, 'is_api': True, 'is_active': True,
+ 'nickname': nickname,
+ 'pwdhash': generate_password_hash(password)}
+ with application.app_context():
+ UserController(ignore_context=True).create(**admin)
@manager.command
def fetch_asyncio(user_id=None, feed_id=None):
bgstack15