misc: pass datetime filter as a datetime object, not a function (#20924)
This commit is contained in:
parent
32848a53dc
commit
5c446fc57c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue