@@ -6,6 +5,7 @@ from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now
from django.contrib.auth.models import User
...
@@ -37,20 +37,18 @@ class ProposalSection(models.Model):
@classmethod
def available(cls):
now = datetime.datetime.now()
return cls._default_manager.filter(
Q(start__lt=now) | Q(start=None),
Q(end__gt=now) | Q(end=None),
Q(start__lt=now()) | Q(start=None),
Q(end__gt=now()) | Q(end=None),
Q(closed=False) | Q(closed=None),
)
def is_available(self):
if self.closed:
return False
now = datetime.datetime.now()
if self.start and self.start > now:
if self.start and self.start > now():
return False
if self.end and self.end < now:
if self.end and self.end < now():
return False
return True
...
@@ -96,7 +94,7 @@ class ProposalBase(models.Model):
help_text=_("Anything else you'd like the program committee to know when making their selection: your past experience, etc. This is not made public. Edit using <a href='http://daringfireball.net/projects/markdown/basics' target='_blank'>Markdown</a>.")