From: Yoan Le Clanche Date: Mon, 4 Oct 2021 16:07:35 +0000 (+0200) Subject: Fix issue to detect available jury https://trackers.pilotsystems.net/prebarreau/0273 X-Git-Tag: 2.5.0~54 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f7136cb2b398971918b16bfee150e51da8938ebf;p=teleforma.git Fix issue to detect available jury https://trackers.pilotsystems.net/prebarreau/0273 --- 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']: