8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-26 00:43:46 +00:00

Des @staticmethod pour @Chibrac.

This commit is contained in:
Hugo LEVY-FALK 2017-12-29 19:43:44 +01:00
parent f52f394936
commit e46382b732
2 changed files with 10 additions and 10 deletions

View file

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

View file

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