Fixed a time arithmetics issue in meeting cutoff date methods
- Legacy-Id: 13966
This commit is contained in:
parent
8e942f44a6
commit
2de6855ccd
|
@ -25,6 +25,7 @@ from ietf.name.models import MeetingTypeName, TimeSlotTypeName, SessionStatusNam
|
|||
from ietf.person.models import Person
|
||||
from ietf.utils.storage import NoLocationMigrationFileSystemStorage
|
||||
from ietf.utils.text import xslugify
|
||||
from ietf.utils.timezone import date2datetime
|
||||
|
||||
countries = pytz.country_names.items()
|
||||
countries.sort(lambda x,y: cmp(x[1], y[1]))
|
||||
|
@ -116,7 +117,7 @@ class Meeting(models.Model):
|
|||
cutoff_date = importantdate.date
|
||||
else:
|
||||
cutoff_date = start_date + datetime.timedelta(days=ImportantDateName.objects.get(slug='idcutoff').default_offset_days)
|
||||
cutoff_time = cutoff_date + self.idsubmit_cutoff_time_utc
|
||||
cutoff_time = date2datetime(cutoff_date) + self.idsubmit_cutoff_time_utc
|
||||
return cutoff_time
|
||||
|
||||
def get_01_cutoff(self):
|
||||
|
@ -128,7 +129,7 @@ class Meeting(models.Model):
|
|||
cutoff_date = importantdate.date
|
||||
else:
|
||||
cutoff_date = start_date + datetime.timedelta(days=ImportantDateName.objects.get(slug='idcutoff').default_offset_days)
|
||||
cutoff_time = cutoff_date + self.idsubmit_cutoff_time_utc
|
||||
cutoff_time = date2datetime(cutoff_date) + self.idsubmit_cutoff_time_utc
|
||||
return cutoff_time
|
||||
|
||||
def get_reopen_time(self):
|
||||
|
|
|
@ -34,4 +34,6 @@ def email_time_to_local_timezone(date_string):
|
|||
|
||||
return utc_to_local_timezone(d)
|
||||
|
||||
|
||||
def date2datetime(date, tz=pytz.utc):
|
||||
return datetime.datetime(*(date.timetuple()[:6]), tzinfo=tz)
|
||||
|
||||
|
|
Loading…
Reference in a new issue