diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-12 18:06:05 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-12 18:06:05 +0200 |
commit | 1ba7ccbf06154e2f6f68b59977ea50844fab0d4f (patch) | |
tree | 6467abd2ea6ec3fe00a3d761a8cf4a0e78dfa8e3 /pyaggr3g470r/views.py | |
parent | Bug fix in the /inactives template. (diff) | |
download | newspipe-1ba7ccbf06154e2f6f68b59977ea50844fab0d4f.tar.gz newspipe-1ba7ccbf06154e2f6f68b59977ea50844fab0d4f.tar.bz2 newspipe-1ba7ccbf06154e2f6f68b59977ea50844fab0d4f.zip |
Removed option to disable a user.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r-- | pyaggr3g470r/views.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 0e419dba..d0b410ee 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -647,25 +647,3 @@ def delete_user(user_id=None): else: flash('This user does not exist.', 'danger') return redirect(redirect_url()) - -@app.route('/admin/enable_user/<int:user_id>/', methods=['GET']) -@app.route('/admin/disable_user/<int:user_id>/', methods=['GET']) -@login_required -@admin_permission.require() -def disable_user(user_id=None): - """ - Enable or disable the API key of a user. - """ - user = User.query.filter(User.id == user_id).first() - if user is not None: - if user.apikey != "": - user.pwdhash = "" - flash(user.firstname + '" successfully disabled.', 'success') - else: - #import random, base64, hashlib - user.pwdhash = "newpass" - flash(user.firstname + '" successfully enabled.', 'success') - db.session.commit() - else: - flash('This user does not exist.', 'danger') - return redirect(redirect_url())
\ No newline at end of file |