mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-29 21:11:10 +02:00
Add observer team
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -1992,7 +1992,8 @@ class SynthesisUploadView(LoginRequiredMixin, FormView):
|
||||
self.participation = self.request.user.registration.team.participation
|
||||
self.passage = qs.get()
|
||||
|
||||
if self.participation not in [self.passage.opponent, self.passage.reviewer]:
|
||||
if self.participation \
|
||||
and self.participation not in [self.passage.opponent, self.passage.reviewer, self.passage.observer]:
|
||||
return self.handle_no_permission()
|
||||
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
@ -2004,7 +2005,8 @@ class SynthesisUploadView(LoginRequiredMixin, FormView):
|
||||
It is discriminating whenever the team is selected for the final tournament or not.
|
||||
"""
|
||||
form_syn = form.instance
|
||||
form_syn.type = 1 if self.participation == self.passage.opponent else 2
|
||||
form_syn.type = 1 if self.participation == self.passage.opponent \
|
||||
else 2 if self.participation == self.passage.reviewer else 3
|
||||
syn_qs = Synthesis.objects.filter(participation=self.participation,
|
||||
passage=self.passage,
|
||||
type=form_syn.type).all()
|
||||
@ -2052,6 +2054,8 @@ class NoteUpdateView(VolunteerMixin, UpdateView):
|
||||
form.fields['opponent_oral'].label += f" ({self.object.passage.opponent.team.trigram})"
|
||||
form.fields['reviewer_writing'].label += f" ({self.object.passage.reviewer.team.trigram})"
|
||||
form.fields['reviewer_oral'].label += f" ({self.object.passage.reviewer.team.trigram})"
|
||||
form.fields['observer_writing'].label += f" ({self.object.passage.observer.team.trigram})"
|
||||
form.fields['observer_oral'].label += f" ({self.object.passage.observer.team.trigram})"
|
||||
return form
|
||||
|
||||
def form_valid(self, form):
|
||||
|
Reference in New Issue
Block a user