mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-10 16:24:49 +00:00
Amend GroupForm.save(), so as not to blat non-user-facing django permissions
This commit is contained in:
parent
045644abc1
commit
79d80b5c59
1 changed files with 2 additions and 1 deletions
|
|
@ -179,9 +179,10 @@ class GroupForm(forms.ModelForm):
|
|||
# be clobbered by this form.
|
||||
try:
|
||||
untouchable_permissions = self.instance.permissions.exclude(pk__in=self.registered_permissions)
|
||||
bool(untouchable_permissions) # force this to be evaluated, as it's about to change
|
||||
except ValueError:
|
||||
# this form is not bound; we're probably creating a new group
|
||||
untouchable_permissions = Permission.objects.none()
|
||||
untouchable_permissions = []
|
||||
group = super(GroupForm, self).save()
|
||||
group.permissions.add(*untouchable_permissions)
|
||||
return group
|
||||
|
|
|
|||
Loading…
Reference in a new issue