mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
ca8080b3f4
commit
be95e459f9
1 changed files with 2 additions and 4 deletions
|
|
@ -87,16 +87,14 @@ class LibRAvatarProvider:
|
|||
baseurl = "http://" + hostname + ":" + port + "/avatar/"
|
||||
except Exception:
|
||||
baseurl = "https://seccdn.libravatar.org/avatar/"
|
||||
|
||||
|
||||
params = {"s": str(width)}
|
||||
if settings.AVATAR_GRAVATAR_DEFAULT:
|
||||
params["d"] = settings.AVATAR_GRAVATAR_DEFAULT
|
||||
if settings.AVATAR_GRAVATAR_FORCEDEFAULT:
|
||||
params["f"] = "y"
|
||||
path = "%s/?%s" % (
|
||||
hashlib.md5(
|
||||
force_bytes(email.strip().lower())
|
||||
).hexdigest(),
|
||||
hashlib.md5(force_bytes(email.strip().lower())).hexdigest(),
|
||||
urlencode(params),
|
||||
)
|
||||
return urljoin(baseurl, path)
|
||||
|
|
|
|||
Loading…
Reference in a new issue