Skip to content

Commit

Permalink
control user stage with marker and not current stage
Browse files Browse the repository at this point in the history
Allow users to be on different stages based on the stage value in marker
and not controlled by the value in the current stage table. Means you
can have users doing first mark and audit at the same time.
  • Loading branch information
struan committed Oct 26, 2023
1 parent f29371e commit 0183fb7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crowdsourcer/views/marking.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def get_context_data(self, **kwargs):
context["show_login"] = True
return context

context["show_users"] = self.request.user.is_superuser
user = self.request.user
context["show_users"] = user.is_superuser

assignments = (
context["assignments"]
Expand Down Expand Up @@ -130,9 +131,14 @@ def get_context_data(self, **kwargs):

context["progress"] = progress

if self.current_stage.type == "First Mark":
user_stage = self.current_stage.type
if hasattr(user, "marker"):
if user.marker.response_type:
user_stage = user.marker.response_type.type

if user_stage == "First Mark":
section_link = "section_authorities"
elif self.current_stage.type == "Audit":
elif user_stage == "Audit":
section_link = "audit_section_authorities"

context["page_title"] = "Assignments"
Expand Down

0 comments on commit 0183fb7

Please sign in to comment.