fix current weekday computing
This commit is contained in:
parent
2c6be693f6
commit
07692842fb
|
@ -20,11 +20,11 @@ class Command(BaseCommand):
|
|||
return requests.get(url, headers={'Accept': 'application/json'})
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
if datetime.date.today().weekday() in (5, 6):
|
||||
if datetime.today().weekday() in (5, 6):
|
||||
# we don't notify during the weekend
|
||||
return
|
||||
tomorrows = [datetime.today() + timedelta(days=1)]
|
||||
if datetime.date.today().weekday() == 4:
|
||||
if datetime.today().weekday() == 4:
|
||||
# on Fridays we also notify about Sundays (just to be sure) and Mondays
|
||||
tomorrows.append(datetime.today() + timedelta(days=2))
|
||||
tomorrows.append(datetime.today() + timedelta(days=3))
|
||||
|
|
Loading…
Reference in New Issue