diff --git a/anatomy/views.py b/anatomy/views.py index 61b4e069..d8fe5113 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -96,7 +96,7 @@ def question_list(request): def question_detail(request, pk): question = get_object_or_404(AnatomyQuestion, pk=pk) - if not question.open_access and not self.request.user.groups.filter(name="anatomy_checker").exists() : + if not question.open_access and not request.user.groups.filter(name="anatomy_checker").exists() : raise PermissionDenied() return render(request, "anatomy/question_detail.html", {"question": question})