1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-24 07:48:48 +02:00

Add button to update notes

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-03-24 11:28:41 +01:00
parent 64b7644e5e
commit 6fa3a08a72
7 changed files with 73 additions and 53 deletions

View File

@ -1527,9 +1527,9 @@ class PassageDetailView(LoginRequiredMixin, DetailView):
context = super().get_context_data(**kwargs)
if self.request.user.registration in self.object.pool.juries.all():
context["my_note"] = Note.objects.get_or_create(passage=self.object, jury=self.request.user.registration)[0]
context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
context["notes"] = NoteTable(self.object.notes.all())
elif self.request.user.registration.is_admin:
context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
context["notes"] = NoteTable(self.object.notes.all())
if 'notes' in context and not self.object.observer:
# Only display the observer column for 4-teams pools
context['notes']._sequence.pop()