misc: pass datetime filter as a datetime object, not a function (#20924)

This commit is contained in:
Frédéric Péters 2017-12-30 10:48:11 +01:00
parent 32848a53dc
commit 5c446fc57c
1 changed files with 1 additions and 1 deletions

View File

@ -424,7 +424,7 @@ class Desk(models.Model):
def get_exceptions_within_two_weeks(self):
in_two_weeks = datetime.datetime.today() + datetime.timedelta(days=14)
exceptions = self.timeperiodexception_set.filter(
end_datetime__gte=now, end_datetime__lte=in_two_weeks)
end_datetime__gte=now(), end_datetime__lte=in_two_weeks)
if exceptions.exists():
return exceptions
# if none found within the 2 coming weeks, return the next one