From 3959253297ccb636b2281971cdbcd24b7f795773 Mon Sep 17 00:00:00 2001 From: witold Date: Thu, 31 Mar 2022 17:57:21 +0200 Subject: [PATCH] fixes pylint 2.13.4 issues --- lab/admin/mixins.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/lab/admin/mixins.py b/lab/admin/mixins.py index ddfb5654a..9da50300c 100644 --- a/lab/admin/mixins.py +++ b/lab/admin/mixins.py @@ -79,35 +79,30 @@ def has_delete_permission( >= self.lab_permissions.delete_permission ) - @staticmethod - def has_module_permission(request: HttpRequest) -> bool: + # pylint: disable=no-self-use + def has_module_permission(self, request: HttpRequest) -> bool: return request.user.is_staff class LabAdminAllowedMixin: """Gives permission to every action to lab admin and restricts others.""" - @staticmethod - # pylint: disable=unused-argument - def has_module_permission(request: HttpRequest) -> bool: + # pylint: disable=unused-argument,no-self-use + def has_module_permission(self, request: HttpRequest) -> bool: return request.user.is_staff and is_lab_admin(request.user) - @staticmethod - # pylint: disable=unused-argument - def has_view_permission(request: HttpRequest, obj: Optional[T] = None): + # pylint: disable=unused-argument,no-self-use + def has_view_permission(self, request: HttpRequest, obj: Optional[T] = None): return request.user.is_staff and is_lab_admin(request.user) - @staticmethod - # pylint: disable=unused-argument - def has_add_permission(request: HttpRequest, obj: Optional[T] = None): + # pylint: disable=unused-argument,no-self-use + def has_add_permission(self, request: HttpRequest, obj: Optional[T] = None): return request.user.is_staff and is_lab_admin(request.user) - @staticmethod - # pylint: disable=unused-argument - def has_change_permission(request: HttpRequest, obj: Optional[T] = None): + # pylint: disable=unused-argument,no-self-use + def has_change_permission(self, request: HttpRequest, obj: Optional[T] = None): return request.user.is_staff and is_lab_admin(request.user) - @staticmethod - # pylint: disable=unused-argument - def has_delete_permission(request: HttpRequest, obj: Optional[T] = None): + # pylint: disable=unused-argument,no-self-use + def has_delete_permission(self, request: HttpRequest, obj: Optional[T] = None): return request.user.is_staff and is_lab_admin(request.user)