This commit is contained in:
Ross
2021-11-23 19:39:00 +00:00
parent c53e287945
commit 58656f8d6a
+3 -3
View File
@@ -1,5 +1,5 @@
from django.core.exceptions import PermissionDenied
from .models import Atlas, Series
from .models import Case, Series
def user_is_author_or_atlas_series_checker_or_atlas_marker(function):
def wrap(request, *args, **kwargs):
@@ -25,7 +25,7 @@ def user_is_author_or_atlas_series_checker(function):
def user_is_author_or_atlas_checker_or_atlas_marker(function):
def wrap(request, *args, **kwargs):
atlas = Atlas.objects.get(pk=kwargs['pk'])
atlas = Case.objects.get(pk=kwargs['pk'])
if request.user in atlas.author.all() or request.user.groups.filter(name='atlas_checker').exists() or request.user.groups.filter(name='atlas_marker').exists() or request.user.is_superuser:
return function(request, *args, **kwargs)
else:
@@ -36,7 +36,7 @@ def user_is_author_or_atlas_checker_or_atlas_marker(function):
def user_is_author_or_atlas_checker(function):
def wrap(request, *args, **kwargs):
atlas = Atlas.objects.get(pk=kwargs['pk'])
atlas = Case.objects.get(pk=kwargs['pk'])
if request.user in atlas.author.all() or request.user.groups.filter(name='atlas_checker').exists() or request.user.is_superuser:
return function(request, *args, **kwargs)
else: