From ccdf7c36ca26518ee5adf0c9a812ec541119c7ee Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 5 Dec 2013 11:34:17 -0500 Subject: Add support for libravatar.org --- hyperkitty/views/accounts.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hyperkitty/views/accounts.py') 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) -- cgit