diff --git a/anatomy/views.py b/anatomy/views.py index 0c37df3c..0bf800e1 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -101,7 +101,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 request.user.groups.filter(name="anatomy_checker").exists() and request.user not in question.author): + if not question.open_access and (not request.user.groups.filter(name="anatomy_checker").exists() and request.user not in question.author.all()): raise PermissionDenied() return render(request, "anatomy/question_detail.html", {"question": question})