Fix logical issues surrounding Gravatar fetch

This commit is contained in:
amcmanu3 2022-09-19 20:00:15 -04:00
parent 0829331534
commit 63347f956b
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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,