From 2cfd6a8a658e8b85b28f522511e3d685131988cb Mon Sep 17 00:00:00 2001 From: Ayden Kauffman Date: Tue, 26 Apr 2022 20:53:49 -0400 Subject: [PATCH] Updated timezone.now to timezone.localtime() --- conference/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conference/models.py b/conference/models.py index 5095e1c9b..8b1e65fe5 100644 --- a/conference/models.py +++ b/conference/models.py @@ -138,7 +138,7 @@ def clean(self): raise exceptions.ValidationError('Voting end must be > of voting start') def cfp(self): - today = timezone.now().date() + today = timezone.localtime().date() try: return self.cfp_start <= today <= self.cfp_end except TypeError: @@ -146,7 +146,7 @@ def cfp(self): return False def voting(self): - today = timezone.now().date() + today = timezone.localtime().date() try: return self.voting_start <= today <= self.voting_end except TypeError: @@ -154,12 +154,12 @@ def voting(self): return False def conference(self): - today = timezone.now().date() + today = timezone.localtime().date() return self.conference_start <= today <= self.conference_end @property def has_finished(self): - today = timezone.now().date() + today = timezone.localtime().date() return today > self.conference_end @@ -834,7 +834,7 @@ def __str__(self): class FareQuerySet(models.QuerySet): def available(self, conference=None): - today = timezone.now().date() + today = timezone.localtime().date() q1 = models.Q(start_validity=None, end_validity=None) q2 = models.Q(start_validity__lte=today, end_validity__gte=today) qs = self.filter(q1 | q2) @@ -892,7 +892,7 @@ class Meta: def valid(self): # numb = len(list(Ticket.objects.all())) - today = timezone.now().date() + today = timezone.localtime().date() try: validity = self.start_validity <= today <= self.end_validity except TypeError: