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