summaryrefslogtreecommitdiffstats
path: root/hyperkitty/views/accounts.py
diff options
context:
space:
mode:
authorRalph Bean <rbean@redhat.com>2013-12-05 11:34:17 -0500
committerRalph Bean <rbean@redhat.com>2013-12-05 11:34:17 -0500
commitccdf7c36ca26518ee5adf0c9a812ec541119c7ee (patch)
tree908f1843794a356c11845fb08fda54ef139ff984 /hyperkitty/views/accounts.py
parentb3ffd97a0b433647a53ecd7a5cc63f7bdc1e1ee2 (diff)
downloadhyperkitty-ccdf7c36ca26518ee5adf0c9a812ec541119c7ee.tar.gz
hyperkitty-ccdf7c36ca26518ee5adf0c9a812ec541119c7ee.tar.xz
hyperkitty-ccdf7c36ca26518ee5adf0c9a812ec541119c7ee.zip
Add support for libravatar.org
Diffstat (limited to 'hyperkitty/views/accounts.py')
-rw-r--r--hyperkitty/views/accounts.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/hyperkitty/views/accounts.py b/hyperkitty/views/accounts.py
index 836d524..e7ca11d 100644
--- a/hyperkitty/views/accounts.py
+++ b/hyperkitty/views/accounts.py
@@ -138,12 +138,19 @@ def user_profile(request):
"msg": FLASH_MESSAGES[flash_msg][1] }
flash_messages.append(flash_msg)
+ # Extract the gravatar_url used by django_gravatar2. The site
+ # administrator could alternatively set this to http://cdn.libravatar.org/
+ gravatar_url = getattr(settings, 'GRAVATAR_URL', 'http://www.gravatar.com')
+ gravatar_shortname = '.'.join(gravatar_url.split('.')[-2:]).strip('/')
+
context = {
'user_profile' : user_profile,
'form': form,
'emails': emails,
'favorites': favorites,
'flash_messages': flash_messages,
+ 'gravatar_url': gravatar_url,
+ 'gravatar_shortname': gravatar_shortname,
}
return render(request, "user_profile.html", context)