mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-08-17 17:18:53 +02:00
Add observer notes
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user