Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Changed CFP and other conference time checks to local time #1459

Open
wants to merge 1 commit into
base: ep2021
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions conference/models.py
Expand Up @@ -138,28 +138,28 @@ 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:
# there is no date, return False
return False

def voting(self):
today = timezone.now().date()
today = timezone.localtime().date()
try:
return self.voting_start <= today <= self.voting_end
except TypeError:
# there is no date, return False
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


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down