diff options
Diffstat (limited to 'okupy/accounts/views.py')
-rw-r--r-- | okupy/accounts/views.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/okupy/accounts/views.py b/okupy/accounts/views.py index febe39b..6487c8b 100644 --- a/okupy/accounts/views.py +++ b/okupy/accounts/views.py @@ -49,6 +49,7 @@ from okupy.otp.totp.models import TOTPDevice import openid.yadis.discover import openid.fetchers import django_otp +import hashlib import io import ldap import logging @@ -481,12 +482,17 @@ def email_settings(request): if email_settings.is_valid(): try: email = email_settings.cleaned_data['email'] + gravatar_mail = email_settings.cleaned_data['gravatar'] if request.POST.get('delete'): user_info.email.remove(email) else: user_info.email.append(email) + if gravatar_mail: + gravatar_hash = hashlib.md5(gravatar_mail).hexdigest() + user_info.gravatar = gravatar_hash + try: user_info.save() except IntegrityError: |