From a7d7d9adc7d27cc899f15aa58f0935fd9eb47218 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 25 Apr 2022 22:47:55 +0100 Subject: [PATCH] . --- atlas/decorators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atlas/decorators.py b/atlas/decorators.py index f7b3b31b..28966320 100755 --- a/atlas/decorators.py +++ b/atlas/decorators.py @@ -73,7 +73,10 @@ def user_is_author_or_atlas_editor(function): def user_is_collection_author_or_atlas_editor(function): def wrap(request, *args, **kwargs): - atlas = CaseCollection.objects.get(pk=kwargs["pk"]) + if "exam_id" in kwargs: + atlas = CaseCollection.objects.get(pk=kwargs["exam_id"]) + else: + atlas = CaseCollection.objects.get(pk=kwargs["pk"]) if ( request.user in atlas.author.all() or request.user.groups.filter(name="atlas_editor").exists()