def groups_remove(self, queryset, _user=None): with transaction.atomic(): event_role_edited.commit(actor=_user, target=self) for obj in queryset: self.groups.remove(obj) event_group_edited.commit(actor=_user, action_object=self, target=obj)
def method_group_roles_add(self, queryset, _user): with transaction.atomic(): event_group_edited.commit( actor=_user, target=self ) for role in queryset: self.roles.add(role) event_role_edited.commit( actor=_user, action_object=self, target=role )