diff options
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/templatetags/templatetags/gravatar_local.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/lib/templatetags/templatetags/gravatar_local.py b/app/lib/templatetags/templatetags/gravatar_local.py index 985ed03..5ed9a7f 100644 --- a/app/lib/templatetags/templatetags/gravatar_local.py +++ b/app/lib/templatetags/templatetags/gravatar_local.py @@ -1,7 +1,7 @@ from django import template from django.utils.html import escape -from django_gravatar.helpers import calculate_gravatar_hash +from django_gravatar.helpers import calculate_gravatar_hash, has_gravatar # Get template.Library instance register = template.Library() @@ -17,4 +17,11 @@ def gravatar_hash(user_or_email): except: return '' +@register.filter +def has_grav(email): + if has_gravatar(email): + return True + else: + return False + register.simple_tag(gravatar_hash) |