fix date sorting strava
This commit is contained in:
@@ -9,7 +9,7 @@ from rowers.tasks import handle_send_email_alert
|
||||
|
||||
from rowers import alerts
|
||||
|
||||
from rowers.utils import myqueue
|
||||
from rowers.utils import myqueue, dologging
|
||||
|
||||
import datetime
|
||||
|
||||
@@ -38,7 +38,7 @@ class Command(BaseCommand):
|
||||
testing = False
|
||||
|
||||
todaysalerts = Alert.objects.filter(
|
||||
next_run__lt=datetime.date.today(), emailalert=True)
|
||||
next_run__lte=datetime.date.today(), emailalert=True)
|
||||
|
||||
for alert in todaysalerts:
|
||||
stats = alerts.alert_get_stats(alert)
|
||||
@@ -57,6 +57,11 @@ class Command(BaseCommand):
|
||||
stats, debug=True,
|
||||
othertexts=othertexts)
|
||||
|
||||
dologging('alerts.log', 'Sent alert {id} to {email}'.format(
|
||||
id = alert.id,
|
||||
email = alert.manager.email,
|
||||
))
|
||||
|
||||
# advance next_run
|
||||
if not testing:
|
||||
alert.next_run = datetime.date.today() + datetime.timedelta(days=alert.period-1)
|
||||
|
||||
Reference in New Issue
Block a user