From 7df562ab189053a1ac320ed555dd344d58226fd1 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 6 Jan 2020 10:02:41 +0100 Subject: [PATCH] fixing next_run date shift issue on Alert --- rowers/management/commands/processalerts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rowers/management/commands/processalerts.py b/rowers/management/commands/processalerts.py index febfe20f..12937fcd 100644 --- a/rowers/management/commands/processalerts.py +++ b/rowers/management/commands/processalerts.py @@ -45,7 +45,7 @@ class Command(BaseCommand): # explanatorytexts othertexts = [alert.description()] - + # send email job = myqueue(queue,handle_send_email_alert, alert.manager.email, @@ -58,11 +58,11 @@ class Command(BaseCommand): # advance next_run if not testing: - alert.next_run = datetime.date.today() + datetime.timedelta(days=alert.period) + alert.next_run = datetime.date.today() + datetime.timedelta(days=alert.period-1) alert.save() if testing: print('{nr} alerts found'.format(nr = len(todaysalerts))) - + self.stdout.write(self.style.SUCCESS( 'Successfully processed alerts'))