Allow superusers to bypass open access check in question detail view

This commit is contained in:
Ross
2025-11-10 09:16:10 +00:00
parent 390f6f098d
commit e37a7e0b74
+3 -1
View File
@@ -3610,7 +3610,9 @@ class GenericViewBase:
def question_detail(self, request, pk): def question_detail(self, request, pk):
question: QuestionBase = get_object_or_404(self.question_object, pk=pk) question: QuestionBase = get_object_or_404(self.question_object, pk=pk)
if not question.open_access: if request.user.is_superuser:
pass
elif not question.open_access:
if ( if (
not request.user.groups.filter(name=self.checker_group).exists() not request.user.groups.filter(name=self.checker_group).exists()
and request.user not in question.author.all() and request.user not in question.author.all()