aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyaggr3g470r/templates/admin/dashboard.html4
-rw-r--r--pyaggr3g470r/views.py2
2 files changed, 3 insertions, 3 deletions
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 @@
<a href="/admin/user/{{ user.id }}/"><i class="glyphicon glyphicon-user" title="{{ _('View this user') }}<"></i></a>
<a href="/admin/edit_user/{{ user.id }}/"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this user') }}"></i></a>
{% if user.activation_key == "" %}
- <a href="/admin/enable_user/{{ user.id }}/"><i class="glyphicon glyphicon-ban-circle" title="Disable this account"></i></a>
+ <a href="/admin/disable_user/{{ user.id }}/"><i class="glyphicon glyphicon-ban-circle" title="Disable this account"></i></a>
{% else %}
- <a href="/admin/disable_user/{{ user.id }}/"><i class="glyphicon glyphicon-ok-circle" title="Enable this account"></i></a>
+ <a href="/admin/enable_user/{{ user.id }}/"><i class="glyphicon glyphicon-ok-circle" title="Enable this account"></i></a>
{% endif %}
<a href="/admin/delete_user/{{ user.id }}/"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this user') }}" onclick="return confirm('{{ _('You are going to delete this account.') }}');"></i></a>
</td>
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()
bgstack15