This commit is contained in:
Ross
2021-07-28 20:00:06 +01:00
parent 37521a9204
commit 84bfb704bc
3 changed files with 38 additions and 28 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ from django.core.exceptions import PermissionDenied
class AuthorOrCheckerRequiredMixin(object):
def get_object(self, *args, **kwargs):
obj = super().get_object(*args, **kwargs)
if self.request.user.groups.filter(name="physics_checker").exists():
if self.request.user.groups.filter(name="sbas_checker").exists():
return obj
if self.request.user not in obj.author.all():
raise PermissionDenied() # or Http404