8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-24 04:13:12 +00:00

Inchallah ça va mieux marcher (fix la modification des fields pendant le parcours).

This commit is contained in:
LEVY-FALK Hugo 2017-12-30 01:44:32 +01:00 committed by root
parent bd57e39ee9
commit 5fea2bdebd

View file

@ -66,8 +66,11 @@ class FieldPermissionFormMixin:
user = kwargs.pop('user') user = kwargs.pop('user')
super(FieldPermissionFormMixin, self).__init__(*args, **kwargs) super(FieldPermissionFormMixin, self).__init__(*args, **kwargs)
to_be_deleted = []
for name in self.fields: for name in self.fields:
if not self.instance.has_field_perm(user, field=name): if not self.instance.has_field_perm(user, field=name):
to_be_deleted.append(name)
for name in to_be_deleted:
self.remove_unauthorized_field(name) self.remove_unauthorized_field(name)
def remove_unauthorized_field(self, name): def remove_unauthorized_field(self, name):