diff --git a/app/lib/utils.py b/app/lib/utils.py index 3498c10..45799c2 100644 --- a/app/lib/utils.py +++ b/app/lib/utils.py @@ -3,6 +3,8 @@ import sys import json import requests import urlparse +import hashlib + from app import app from distutils.version import StrictVersion @@ -145,3 +147,7 @@ def pdns_api_extended_uri(version): return "/api/v1" else: return "" + +def email_to_gravatar_url(email, size=100): + hash_string = hashlib.md5(email).hexdigest() + return "https://s.gravatar.com/avatar/%s?s=%s" % (hash_string, size) diff --git a/app/templates/base.html b/app/templates/base.html index fd25cc7..06f239b 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -65,7 +65,7 @@ {% if current_user.avatar %} User Image {% else %} - User Image + User Image {% endif %}