mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 17:42:24 +00:00
Fix solution view
This commit is contained in:
parent
de76abab5f
commit
30a0e63eb9
@ -541,11 +541,14 @@ 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
|
||||||
passage_participant_qs = Passage.objects.filter(Q(defender=user.registration.team.participation)
|
if user.registration.participates:
|
||||||
| Q(opponent=user.registration.team.participation)
|
passage_participant_qs = Passage.objects.filter(Q(defender=user.registration.team.participation)
|
||||||
| Q(reporter=user.registration.team.participation),
|
| Q(opponent=user.registration.team.participation)
|
||||||
defender=solution.participation,
|
| Q(reporter=user.registration.team.participation),
|
||||||
solution_number=solution.problem)
|
defender=solution.participation,
|
||||||
|
solution_number=solution.problem)
|
||||||
|
else:
|
||||||
|
passage_participant_qs = Passage.objects.none()
|
||||||
if not (user.registration.is_admin or user.registration.is_volunteer
|
if not (user.registration.is_admin or user.registration.is_volunteer
|
||||||
and Passage.objects.filter(Q(pool__juries=user.registration)
|
and Passage.objects.filter(Q(pool__juries=user.registration)
|
||||||
| Q(pool__tournament__in=user.registration.organized_tournaments.all()),
|
| Q(pool__tournament__in=user.registration.organized_tournaments.all()),
|
||||||
|
Loading…
Reference in New Issue
Block a user