mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix logical issues surrounding Gravatar fetch
This commit is contained in:
parent
0829331534
commit
63347f956b
@ -157,7 +157,7 @@ class UsersController:
|
||||
base_data = HelperUsers.get_user(user_id)
|
||||
up_data = {}
|
||||
# check if we updated user email. If so we update gravatar
|
||||
if user_data["email"]:
|
||||
if user_data["email"] != base_data["email"]:
|
||||
pfp = self.helper.get_gravatar_image(user_data["email"])
|
||||
up_data["pfp"] = pfp
|
||||
# create sets to store role data
|
||||
|
@ -668,7 +668,7 @@ class Helpers:
|
||||
rating = "g"
|
||||
|
||||
# Get grvatar hash for profile pictures
|
||||
if not self.check_internet() or email != "default@example.com" or email != "":
|
||||
if self.check_internet() and email != "default@example.com" and email:
|
||||
gravatar = libgravatar.Gravatar(libgravatar.sanitize_email(email))
|
||||
url = gravatar.get_image(
|
||||
size=80,
|
||||
|
Loading…
Reference in New Issue
Block a user