mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Only check for gravatar if internet
This commit is contained in:
parent
1b2fef06fb
commit
375df0c27d
@ -338,7 +338,11 @@ class PanelHandler(BaseHandler):
|
||||
rating = "g"
|
||||
|
||||
# Get grvatar hash for profile pictures
|
||||
if exec_user["email"] != "default@example.com" or "":
|
||||
if (
|
||||
self.helper.check_internet()
|
||||
and exec_user["email"] != "default@example.com"
|
||||
and exec_user["email"] == ""
|
||||
):
|
||||
gravatar = libgravatar.Gravatar(
|
||||
libgravatar.sanitize_email(exec_user["email"])
|
||||
)
|
||||
|
@ -28,7 +28,11 @@ class ApiUsersUserPfpHandler(BaseApiHandler):
|
||||
rating = "g"
|
||||
|
||||
# Get grvatar hash for profile pictures
|
||||
if user["email"] != "default@example.com" or "":
|
||||
if (
|
||||
self.helper.check_internet()
|
||||
and user["email"] != "default@example.com"
|
||||
and user["email"] == ""
|
||||
):
|
||||
gravatar = libgravatar.Gravatar(libgravatar.sanitize_email(user["email"]))
|
||||
url = gravatar.get_image(
|
||||
size=80,
|
||||
|
@ -138,7 +138,11 @@ class ServerHandler(BaseHandler):
|
||||
else:
|
||||
rating = "g"
|
||||
|
||||
if exec_user["email"] != "default@example.com" or "":
|
||||
if (
|
||||
self.helper.check_internet()
|
||||
and exec_user["email"] != "default@example.com"
|
||||
and exec_user["email"] == ""
|
||||
):
|
||||
gravatar = libgravatar.Gravatar(
|
||||
libgravatar.sanitize_email(exec_user["email"])
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user