mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +00:00
Des @staticmethod pour @Chibrac.
This commit is contained in:
parent
20be7fdb63
commit
bd57e39ee9
2 changed files with 10 additions and 10 deletions
|
@ -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 = {
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue