Update web/core/models_ann.py
This commit is contained in:
parent
44ace418c7
commit
21807d1530
@ -20,14 +20,7 @@ class Announcement(models.Model):
|
|||||||
return self.title or f"Announcement #{self.pk}"
|
return self.title or f"Announcement #{self.pk}"
|
||||||
|
|
||||||
def is_current(self):
|
def is_current(self):
|
||||||
now = timezone.now()
|
return bool(self.is_active)
|
||||||
if not self.is_active:
|
|
||||||
return False
|
|
||||||
if self.start_at and now < self.start_at:
|
|
||||||
return False
|
|
||||||
if self.end_at and now > self.end_at:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
class AnnouncementDismissal(models.Model):
|
class AnnouncementDismissal(models.Model):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user