feat(models.py): add EventPage.is_past property
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user