mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 17:42:24 +00:00
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
|
raise Http404
|
||||||
solution = Solution.objects.get(file__endswith=filename)
|
solution = Solution.objects.get(file__endswith=filename)
|
||||||
user = request.user
|
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)
|
passage_participant_qs = Passage.objects.filter(Q(defender=user.registration.team.participation)
|
||||||
| Q(opponent=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,
|
defender=solution.participation,
|
||||||
solution_number=solution.problem)
|
solution_number=solution.problem)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user