From 136daeafa1f3dd4efbfd1e7cbd486da7ff7707a3 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 2 Nov 2023 16:50:31 +0000 Subject: [PATCH] update section authority page to handle new assignment structure --- crowdsourcer/views/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crowdsourcer/views/base.py b/crowdsourcer/views/base.py index 37a0e990..3ff7992f 100644 --- a/crowdsourcer/views/base.py +++ b/crowdsourcer/views/base.py @@ -121,7 +121,6 @@ def get_queryset(self): if not Assigned.is_user_assigned( self.request.user, section=self.kwargs["section_title"], - current_stage=self.current_stage, ): return None @@ -129,14 +128,17 @@ def get_queryset(self): section = Section.objects.get(title=self.kwargs["section_title"]) questions = Question.objects.filter(section=section, how_marked__in=self.types) + if hasattr(self.request.user, "marker"): + this_stage = self.request.user.marker.response_type + question_list = list(questions.values_list("id", flat=True)) assigned = None if not self.request.user.is_superuser: assigned = Assigned.objects.filter( user=self.request.user, + active=True, section=section, - response_type=self.current_stage, authority__isnull=False, ).values_list("authority__id", flat=True)