feat(models.py): add EventPage.is_past property

This commit is contained in:
2026-03-16 13:32:22 +01:00
parent f609144a84
commit c488ef3420

View File

@@ -123,6 +123,12 @@ class EventPage(Page):
def attendees_count(self): def attendees_count(self):
return self.signed_up_users.count() # pyright: ignore[reportAttributeAccessIssue] return self.signed_up_users.count() # pyright: ignore[reportAttributeAccessIssue]
@property
def is_past(self):
from django.utils import timezone
return self.end < timezone.now()
def _user_signed_up(self, user): def _user_signed_up(self, user):
if not user.is_authenticated: if not user.is_authenticated:
return False return False