From ef691eda5c37ae0267cfd99d7d4c48f75d37d984 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Fri, 2 Feb 2024 19:51:17 +0000 Subject: [PATCH] Add exclude for E1101: Module 'nh3' has no 'clean' member --False Positive-- Issue tracking (fix planned for pylint 4.0.0) https://github.com/messense/nh3/issues/18 https://github.com/pylint-dev/pylint/issues/8756 --- app/classes/web/base_handler.py | 2 +- app/classes/web/panel_handler.py | 16 ++++++++++++---- app/classes/web/public_handler.py | 21 +++++++++++++++------ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/app/classes/web/base_handler.py b/app/classes/web/base_handler.py index ad490c2f..ced6cb97 100644 --- a/app/classes/web/base_handler.py +++ b/app/classes/web/base_handler.py @@ -106,7 +106,7 @@ class BaseHandler(tornado.web.RequestHandler): if type(text) in self.nobleach: logger.debug("Auto-bleaching - bypass type") return text - return nh3.clean(text) + return nh3.clean(text) # pylint: disable=no-member def get_argument( self, diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 0dc1df31..08dd1c85 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -80,7 +80,9 @@ class PanelHandler(BaseHandler): ) in self.controller.crafty_perms.list_defined_crafty_permissions(): argument = int( float( - nh3.clean(self.get_argument(f"permission_{permission.name}", "0")) + nh3.clean( + self.get_argument(f"permission_{permission.name}", "0") + ) # pylint: disable=no-member ) ) if argument: @@ -89,7 +91,9 @@ class PanelHandler(BaseHandler): ) q_argument = int( - float(nh3.clean(self.get_argument(f"quantity_{permission.name}", "0"))) + float( + nh3.clean(self.get_argument(f"quantity_{permission.name}", "0")) + ) # pylint: disable=no-member ) if q_argument: server_quantity[permission.name] = q_argument @@ -503,7 +507,9 @@ class PanelHandler(BaseHandler): template = "panel/dashboard.html" elif page == "server_detail": - subpage = nh3.clean(self.get_argument("subpage", "")) + subpage = nh3.clean( + self.get_argument("subpage", "") + ) # pylint: disable=no-member server_id = self.check_server_id() # load page the user was on last @@ -1362,7 +1368,9 @@ class PanelHandler(BaseHandler): template = "panel/panel_edit_user_apikeys.html" elif page == "remove_user": - user_id = nh3.clean(self.get_argument("id", None)) + user_id = nh3.clean( + self.get_argument("id", None) + ) # pylint: disable=no-member if ( not superuser diff --git a/app/classes/web/public_handler.py b/app/classes/web/public_handler.py index 7df88f68..101727eb 100644 --- a/app/classes/web/public_handler.py +++ b/app/classes/web/public_handler.py @@ -29,8 +29,12 @@ class PublicHandler(BaseHandler): # self.clear_cookie("user_data") def get(self, page=None): - error = nh3.clean(self.get_argument("error", "Invalid Login!")) - error_msg = nh3.clean(self.get_argument("error_msg", "")) + error = nh3.clean( + self.get_argument("error", "Invalid Login!") + ) # pylint: disable=no-member + error_msg = nh3.clean( + self.get_argument("error_msg", "") + ) # pylint: disable=no-member page_data = { "version": self.helper.get_version_string(), @@ -87,8 +91,12 @@ class PublicHandler(BaseHandler): ) def post(self, page=None): - error = nh3.clean(self.get_argument("error", "Invalid Login!")) - error_msg = nh3.clean(self.get_argument("error_msg", "")) + error = nh3.clean( + self.get_argument("error", "Invalid Login!") + ) # pylint: disable=no-member + error_msg = nh3.clean( + self.get_argument("error_msg", "") + ) # pylint: disable=no-member page_data = { "version": self.helper.get_version_string(), @@ -108,10 +116,11 @@ class PublicHandler(BaseHandler): if self.request.query: next_page = "/login?" + self.request.query - entered_username = nh3.clean(self.get_argument("username")) + entered_username = nh3.clean( + self.get_argument("username") + ) # pylint: disable=no-member entered_password = self.get_argument("password") - # pylint: disable=no-member try: user_id = HelperUsers.get_user_id_by_name(entered_username.lower()) user_data = HelperUsers.get_user_model(user_id)