This commit is contained in:
Ross
2022-04-25 22:47:55 +01:00
parent b804efbcbd
commit a7d7d9adc7
+4 -1
View File
@@ -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()