From bd57e39ee9cefe3a71696ac2ad48bcf1bdcc79ab Mon Sep 17 00:00:00 2001 From: LEVY-FALK Hugo Date: Fri, 29 Dec 2017 19:43:44 +0100 Subject: [PATCH] Des @staticmethod pour @Chibrac. --- cotisations/models.py | 8 ++++---- users/models.py | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cotisations/models.py b/cotisations/models.py index 0e5b49ef..36550c2e 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -149,12 +149,12 @@ class Facture(FieldPermissionModelMixin, models.Model): else: return True, None - @classmethod - def can_change_control(cls, user_request, *args, **kwargs): + @staticmethod + def can_change_control(user_request, *args, **kwargs): return user_request.has_perms(('tresorier',)), "Vous ne pouvez pas éditer le controle sans droit trésorier" - @classmethod - def can_change_pdf(cls, user_request, *args, **kwargs): + @staticmethod + def can_change_pdf(user_request, *args, **kwargs): return user_request.has_perms(('tresorier',)), "Vous ne pouvez pas éditer une facture sans droit trésorier" field_permissions = { diff --git a/users/models.py b/users/models.py index 3233ae86..5e852fd8 100644 --- a/users/models.py +++ b/users/models.py @@ -820,16 +820,16 @@ class User(FieldPermissionModelMixin, AbstractBaseUser): else: return False, u"Vous ne pouvez éditer un autre utilisateur que vous même" - @classmethod - def can_change_state(cls, user_request, *args, **kwargs): + @staticmethod + def can_change_state(user_request, *args, **kwargs): return user_request.has_perms(('bureau',)), "Droit bureau requis pour changer l'état" - @classmethod - def can_change_shell(cls, user_request, *args, **kwargs): + @staticmethod + def can_change_shell(user_request, *args, **kwargs): return user_request.has_perms(('cableur',)), "Droit requis pour changer le shell" - @classmethod - def can_change_force(cls, user_request, *args, **kwargs): + @staticmethod + def can_change_force(user_request, *args, **kwargs): return user_request.has_perms(('cableur',)), "Droit requis pour forcer le déménagement" def can_delete(self, user_request, *args, **kwargs):