Fix NoneType error when logging in with AD

This commit is contained in:
Jim Shaver 2016-08-16 01:47:33 +00:00
parent 7ef76484d0
commit 1b1153c7a6

View File

@ -149,5 +149,13 @@ def pdns_api_extended_uri(version):
return "" return ""
def email_to_gravatar_url(email, size=100): def email_to_gravatar_url(email, size=100):
"""
AD doesn't necessarily have email
"""
if not email:
email=""
hash_string = hashlib.md5(email).hexdigest() hash_string = hashlib.md5(email).hexdigest()
return "https://s.gravatar.com/avatar/%s?s=%s" % (hash_string, size) return "https://s.gravatar.com/avatar/%s?s=%s" % (hash_string, size)