fixing next_run date shift issue on Alert
This commit is contained in:
@@ -45,7 +45,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
# explanatorytexts
|
# explanatorytexts
|
||||||
othertexts = [alert.description()]
|
othertexts = [alert.description()]
|
||||||
|
|
||||||
# send email
|
# send email
|
||||||
job = myqueue(queue,handle_send_email_alert,
|
job = myqueue(queue,handle_send_email_alert,
|
||||||
alert.manager.email,
|
alert.manager.email,
|
||||||
@@ -58,11 +58,11 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
# advance next_run
|
# advance next_run
|
||||||
if not testing:
|
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()
|
alert.save()
|
||||||
|
|
||||||
if testing:
|
if testing:
|
||||||
print('{nr} alerts found'.format(nr = len(todaysalerts)))
|
print('{nr} alerts found'.format(nr = len(todaysalerts)))
|
||||||
|
|
||||||
self.stdout.write(self.style.SUCCESS(
|
self.stdout.write(self.style.SUCCESS(
|
||||||
'Successfully processed alerts'))
|
'Successfully processed alerts'))
|
||||||
|
|||||||
Reference in New Issue
Block a user