fix current weekday computing

This commit is contained in:
Serghei Mihai 2015-12-01 17:10:18 +01:00
parent 2c6be693f6
commit 07692842fb
1 changed files with 2 additions and 2 deletions

View File

@ -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))