fixing next_run date shift issue on Alert
This commit is contained in:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user