mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Fix NoneType error when logging in with AD
This commit is contained in:
parent
7ef76484d0
commit
1b1153c7a6
@ -149,5 +149,13 @@ def pdns_api_extended_uri(version):
|
||||
return ""
|
||||
|
||||
def email_to_gravatar_url(email, size=100):
|
||||
"""
|
||||
AD doesn't necessarily have email
|
||||
"""
|
||||
|
||||
if not email:
|
||||
email=""
|
||||
|
||||
|
||||
hash_string = hashlib.md5(email).hexdigest()
|
||||
return "https://s.gravatar.com/avatar/%s?s=%s" % (hash_string, size)
|
||||
|
Loading…
Reference in New Issue
Block a user