mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
Merge pull request #107 from elitest/fix-gravatar
Fix NoneType error when logging in with AD
This commit is contained in:
commit
d5fd1cc6d6
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user