From 3f2a75741440b4ed03869dea8b8341cc2e351ba4 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Fri, 5 Jul 2024 12:02:08 +0200 Subject: [PATCH] Allow observers to access solutions Signed-off-by: Emmy D'Anello --- registration/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/registration/views.py b/registration/views.py index aa017e8..2d0fe1a 100644 --- a/registration/views.py +++ b/registration/views.py @@ -836,10 +836,11 @@ class SolutionView(LoginRequiredMixin, View): raise Http404 solution = Solution.objects.get(file__endswith=filename) user = request.user - if user.registration.participates: + if user.registration.participates and user.registration.team.participation: passage_participant_qs = Passage.objects.filter(Q(defender=user.registration.team.participation) | Q(opponent=user.registration.team.participation) - | Q(reviewer=user.registration.team.participation), + | Q(reviewer=user.registration.team.participation) + | Q(observer=user.registration.team.participation), defender=solution.participation, solution_number=solution.problem) else: