Skip to content

Commit

Permalink
update section authority page to handle new assignment structure
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Nov 2, 2023
1 parent ec13762 commit 136daea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crowdsourcer/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,24 @@ 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

this_stage = ResponseType.objects.get(type=self.stage)
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)

Expand Down

0 comments on commit 136daea

Please sign in to comment.