From ed1cc0c3944aa27fd889b24beae0b6bebb80241d Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 15 May 2014 17:37:48 +0200 Subject: Fix. --- pyaggr3g470r/templates/admin/dashboard.html | 4 ++-- pyaggr3g470r/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/templates/admin/dashboard.html b/pyaggr3g470r/templates/admin/dashboard.html index 1d9194e0..d40ffdf5 100644 --- a/pyaggr3g470r/templates/admin/dashboard.html +++ b/pyaggr3g470r/templates/admin/dashboard.html @@ -24,9 +24,9 @@ {% if user.activation_key == "" %} - + {% else %} - + {% endif %} diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index a8d6da51..6fd06560 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -794,7 +794,7 @@ def disable_user(user_id=None): flash('Account of the user "' + user.nickname + '" successfully activated.', 'success') else: import random, base64, hashlib - user.apikey = base64.b64encode(hashlib.sha512( str(random.getrandbits(256)) ).digest(), + user.activation_key = base64.b64encode(hashlib.sha512( str(random.getrandbits(256)) ).digest(), random.choice(['rA','aZ','gQ','hH','hG','aR','DD'])).rstrip('==') flash('Account of the user "' + user.nickname + '" successfully disabled.', 'success') db.session.commit() -- cgit