From 2b35da71fcafaf14685ad3ab6bad6999cb19304c Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Fri, 9 Sep 2022 15:04:45 -0400 Subject: [PATCH] Fix logic with gravatar email --- app/classes/web/panel_handler.py | 6 +++--- app/classes/web/routes/api/users/user/pfp.py | 6 +++--- app/classes/web/server_handler.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 0c858772..2192a55b 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -339,9 +339,9 @@ class PanelHandler(BaseHandler): # Get grvatar hash for profile pictures if ( - self.helper.check_internet() - and exec_user["email"] != "default@example.com" - and exec_user["email"] == "" + not self.helper.check_internet() + or exec_user["email"] != "default@example.com" + or exec_user["email"] != "" ): gravatar = libgravatar.Gravatar( libgravatar.sanitize_email(exec_user["email"]) diff --git a/app/classes/web/routes/api/users/user/pfp.py b/app/classes/web/routes/api/users/user/pfp.py index 0e68027c..86e88dbc 100644 --- a/app/classes/web/routes/api/users/user/pfp.py +++ b/app/classes/web/routes/api/users/user/pfp.py @@ -29,9 +29,9 @@ class ApiUsersUserPfpHandler(BaseApiHandler): # Get grvatar hash for profile pictures if ( - self.helper.check_internet() - and user["email"] != "default@example.com" - and user["email"] == "" + not self.helper.check_internet() + or user["email"] != "default@example.com" + or user["email"] != "" ): gravatar = libgravatar.Gravatar(libgravatar.sanitize_email(user["email"])) url = gravatar.get_image( diff --git a/app/classes/web/server_handler.py b/app/classes/web/server_handler.py index 5b5b2c49..954c31ae 100644 --- a/app/classes/web/server_handler.py +++ b/app/classes/web/server_handler.py @@ -139,9 +139,9 @@ class ServerHandler(BaseHandler): rating = "g" if ( - self.helper.check_internet() - and exec_user["email"] != "default@example.com" - and exec_user["email"] == "" + not self.helper.check_internet() + or exec_user["email"] != "default@example.com" + or exec_user["email"] != "" ): gravatar = libgravatar.Gravatar( libgravatar.sanitize_email(exec_user["email"])