Allow observers to access solutions
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
d20d5f6266
commit
3f2a757414
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue