Skip to content

Commit 50710b1

Browse files
committed
api: allow non maintainers to update only attention set
1 parent 9fbcd31 commit 50710b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

patchwork/api/patch.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ def partial_update(self, request, *args, **kwargs):
427427
obj.project in request.user.profile.maintainer_projects.all()
428428
or request.user.is_superuser
429429
)
430+
non_attention_set_keys = [
431+
key for key in request.data if key != 'attention_set'
432+
]
433+
434+
if non_attention_set_keys and not is_maintainer:
435+
raise PermissionDenied(
436+
detail='You do not have permission to edit patch properties.'
437+
)
430438

431439
if 'attention_set' in request.data and request.method in ('PATCH',):
432440
attention_set = request.data.get('attention_set', None)

0 commit comments

Comments
 (0)