diff options
author | luxagraf <sng@luxagraf.net> | 2014-11-13 20:52:00 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2014-11-13 20:52:00 -0500 |
commit | af356c15e2cb6e467bbf452ede9d5a5385584a97 (patch) | |
tree | a5b382292276a49dcb952069ff3a35e34032f41b /app/lib | |
parent | 29cdc473e0eab6611c1b4f702c5139315e016c70 (diff) |
simplified gravatar code to use a single default image
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) |