1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-08-16 22:10:05 +02:00

Add observer notes

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-04-07 12:10:25 +02:00
parent 9eed5ca2a0
commit a382e089ae
9 changed files with 216 additions and 96 deletions

View File

@@ -920,6 +920,9 @@ class PassageDetailView(LoginRequiredMixin, DetailView):
context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
elif self.request.user.registration.is_admin:
context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
if 'notes' in context and not self.object.observer:
# Only display the observer column for 4-teams pools
context['notes']._sequence.pop()
return context
@@ -1003,3 +1006,10 @@ class NoteUpdateView(VolunteerMixin, UpdateView):
return super().dispatch(request, *args, **kwargs)
return self.handle_no_permission()
def get_form(self, form_class=None):
form = super().get_form(form_class)
if not self.object.passage.observer:
# Set the note of the observer only for 4-teams pools
del form.fields['observer_oral']
return form