From f7136cb2b398971918b16bfee150e51da8938ebf Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Mon, 4 Oct 2021 18:07:35 +0200 Subject: [PATCH] Fix issue to detect available jury https://trackers.pilotsystems.net/prebarreau/0273 --- teleforma/models/appointment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teleforma/models/appointment.py b/teleforma/models/appointment.py index 2da396ff..c896dd3d 100644 --- a/teleforma/models/appointment.py +++ b/teleforma/models/appointment.py @@ -121,6 +121,7 @@ class AppointmentPeriod(models.Model): cache.set(cache_key, days[day], 1800) # print days + print(days.values()) return sorted(days.values(), key=lambda d: d['date']) @cached_property @@ -220,7 +221,7 @@ class AppointmentSlot(models.Model): def nb_jurys_to_show(self): min = 100 - for groupslot in AppointmentSlot.objects.filter(date=self.date).all(): + for groupslot in AppointmentSlot.objects.filter(date=self.date, mode=self.mode).all(): for slot in groupslot.slots: for i, jury in enumerate(slot['jurys']): if jury['available']: -- 2.39.5