diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-02-18 22:01:17 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-02-18 22:01:17 +0100 |
commit | 5f53d8c5416a3f4ce6f7d12eb480192f2d80980a (patch) | |
tree | 7f2aa62cc663a26687e1c626dcb2aa419232bcaf /src/web/views/admin.py | |
parent | Rephrasing... (diff) | |
download | newspipe-5f53d8c5416a3f4ce6f7d12eb480192f2d80980a.tar.gz newspipe-5f53d8c5416a3f4ce6f7d12eb480192f2d80980a.tar.bz2 newspipe-5f53d8c5416a3f4ce6f7d12eb480192f2d80980a.zip |
Added a template for the password recovery notifications.
Diffstat (limited to 'src/web/views/admin.py')
-rw-r--r-- | src/web/views/admin.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/web/views/admin.py b/src/web/views/admin.py index 832c134d..b5b0fd54 100644 --- a/src/web/views/admin.py +++ b/src/web/views/admin.py @@ -144,21 +144,7 @@ def toggle_user(user_id=None): flash(gettext('This user does not exist.'), 'danger') return redirect(url_for('admin.dashboard')) - if not user.enabled: - # Send the confirmation email - try: - notifications.new_account_activation(user) - user_contr.update({'id': user.id}, {'enabled': True}) - message = gettext('Account of the user %(nick)s successfully ' - 'activated.', nick=user.nickname) - except Exception as error: - flash(gettext('Problem while sending activation email %(error)s:', - error=error), 'danger') - return redirect(url_for('admin.dashboard')) - - else: - user_contr.update({'id': user.id}, {'enabled': False}) - message = gettext('Account of the user %(nick)s successfully disabled', - nick=user.nickname) - flash(message, 'success') + user_contr.update({'id': user.id}, {'enabled': not user.enabled}) + flash(gettext('Account of the user %(nick)s successfully ' + 'updated.', nick=user.nickname), 'success') return redirect(url_for('admin.dashboard')) |