Skip to content
Snippets Groups Projects
Commit 7f84827a authored by magicfelix's avatar magicfelix
Browse files

Reformat

parent 777261ab
No related branches found
No related tags found
1 merge request!1725Resolve "Editing objects may lead to disappearance of relations to model instances managed by apps"
Pipeline #196537 passed with warnings
......@@ -135,8 +135,10 @@ class PermissionBatchPatchMixin:
@classmethod
def after_update_obj(cls, root, info, input, obj, full_input): # noqa
super().after_update_obj(root, info, input, obj, full_input)
if obj.managed_by_app_label != "" or not isinstance(cls._meta.permissions, Iterable) or not info.context.user.has_perms(
cls._meta.permissions, obj
if (
obj.managed_by_app_label != ""
or not isinstance(cls._meta.permissions, Iterable)
or not info.context.user.has_perms(cls._meta.permissions, obj)
):
raise PermissionDenied()
......@@ -157,7 +159,9 @@ class PermissionBatchDeleteMixin:
if not isinstance(cls._meta.permissions, Iterable):
raise PermissionDenied()
for obj in qs_to_delete:
if obj.managed_by_app_label != "" or not info.context.user.has_perms(cls._meta.permissions, obj):
if obj.managed_by_app_label != "" or not info.context.user.has_perms(
cls._meta.permissions, obj
):
raise PermissionDenied()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment