diff --git a/chrono/agendas/models.py b/chrono/agendas/models.py index 803a666d..4c8d5824 100644 --- a/chrono/agendas/models.py +++ b/chrono/agendas/models.py @@ -35,6 +35,7 @@ from django.core.validators import MaxValueValidator from django.db import models, transaction from django.db.models import Count, Q, Case, When from django.urls import reverse +from django.utils import functional from django.utils.dates import WEEKDAYS from django.utils.encoding import force_text from django.utils.formats import date_format @@ -776,6 +777,10 @@ class Event(models.Model): # label can be empty return slugify(self.label or ('%s-event' % self.agenda.label)) + @functional.cached_property + def main_list_full(self): + return bool(self.booked_places >= self.places) + def check_full(self): self.full = bool( (self.booked_places >= self.places and self.waiting_list_places == 0) diff --git a/chrono/manager/templates/chrono/manager_events_agenda_month_view.html b/chrono/manager/templates/chrono/manager_events_agenda_month_view.html index 5be3728c..a063ebce 100644 --- a/chrono/manager/templates/chrono/manager_events_agenda_month_view.html +++ b/chrono/manager/templates/chrono/manager_events_agenda_month_view.html @@ -9,7 +9,7 @@