]> git.parisson.com Git - teleforma.git/commitdiff
Fix issue to detect available jury https://trackers.pilotsystems.net/prebarreau/0273
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 4 Oct 2021 16:07:35 +0000 (18:07 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 4 Oct 2021 16:07:35 +0000 (18:07 +0200)
teleforma/models/appointment.py

index 2da396ffcd70f451b6e15337582cfaf5625577bf..c896dd3dd5ae830a1b81c12121caa6da735042fc 100644 (file)
@@ -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']: