1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-04 01:32:11 +02:00

Files are required for solutions and syntheses

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
2022-04-29 18:53:34 +02:00
parent c686584e74
commit 5f2cd16071
3 changed files with 25 additions and 5 deletions

View File

@ -751,7 +751,7 @@ class PassageDetailView(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
if self.request.user.registration in self.object.pool.juries.all():
context["my_note"] = Note.objects.get(passage=self.object, jury=self.request.user.registration)
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])
elif self.request.user.registration.is_admin:
context["notes"] = NoteTable([note for note in self.object.notes.all() if note])