diff --git a/rowers/management/commands/processalerts.py b/rowers/management/commands/processalerts.py index 08e39bcc..febfe20f 100644 --- a/rowers/management/commands/processalerts.py +++ b/rowers/management/commands/processalerts.py @@ -38,7 +38,7 @@ class Command(BaseCommand): else: testing = False - todaysalerts = Alert.objects.filter(next_run__lte = datetime.date.today(),emailalert=True) + todaysalerts = Alert.objects.filter(next_run__lt = datetime.date.today(),emailalert=True) for alert in todaysalerts: stats = alerts.alert_get_stats(alert) diff --git a/rowers/stravastuff.py b/rowers/stravastuff.py index f2af5b3c..0ea6ab5c 100644 --- a/rowers/stravastuff.py +++ b/rowers/stravastuff.py @@ -529,9 +529,14 @@ def add_workout_from_data(user,importid,data,strokedata, try: latcoord = strokedata.loc[:,'lat'] loncoord = strokedata.loc[:,'lon'] + if latcoord.std() == 0 and loncoord.std() == 0 and workouttype == 'water': + workouttype = 'rower' except: latcoord = np.zeros(nr_rows) loncoord = np.zeros(nr_rows) + if workouttype == 'water': + workouttype = 'rower' + try: @@ -747,12 +752,18 @@ def handle_strava_import_stroke_data(title, try: lat = coords[:,0] lon = coords[:,1] + if lat.std() == 0 and lon.std() == 0 and workouttype == 'water': + workouttype = 'rower' except IndexError: lat = np.zeros(len(t)) lon = np.zeros(len(t)) + if workouttype == 'water': + workouttype = 'rower' else: lat = np.zeros(len(t)) lon = np.zeros(len(t)) + if workouttype == 'water': + workouttype = 'rower' strokelength = velo*60./(spm) strokelength[np.isinf(strokelength)] = 0.0 diff --git a/rowers/tasks.py b/rowers/tasks.py index 617a3de9..4d22d545 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -809,6 +809,7 @@ def handle_send_email_alert( except KeyError: pass + try: report['Median'] = sigdig(stats['median']) except KeyError: @@ -831,6 +832,8 @@ def handle_send_email_alert( 'report':report, 'first_name':userfirstname, 'last_name':userlastname, + 'startdate':stats['startdate'], + 'enddate':stats['enddate'], 'siteurl':siteurl, 'rowerfirstname':rowerfirstname, 'alertname':alertname, diff --git a/rowers/templates/alertemail.html b/rowers/templates/alertemail.html index d94263dd..1d737ccc 100644 --- a/rowers/templates/alertemail.html +++ b/rowers/templates/alertemail.html @@ -4,7 +4,8 @@
Dear {{ first_name }},
- Here is the report for your alert {{ alertname }} on rowsandall.com. This is a report for your athlete {{ rowerfirstname }}. + Here is the report for your alert {{ alertname }} on rowsandall.com. This is a report for your athlete {{ rowerfirstname }}, covering the period from + {{ startdate }} to {{ enddate }}.
{% for text in othertexts %} diff --git a/rowers/templates/imports.html b/rowers/templates/imports.html index ceb31260..f2bd719a 100644 --- a/rowers/templates/imports.html +++ b/rowers/templates/imports.html @@ -123,8 +123,8 @@ {{ form.as_table }} {% csrf_token %} - diff --git a/rowers/templates/rower_exportsettings.html b/rowers/templates/rower_exportsettings.html index 5138566c..7654abcf 100644 --- a/rowers/templates/rower_exportsettings.html +++ b/rowers/templates/rower_exportsettings.html @@ -20,7 +20,7 @@ The auto import and export settings only work on a {{ form.as_table }} {% csrf_token %} - +Click on one of the icons below to connect to the service of your diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index bae6de41..57c9804d 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -5,6 +5,10 @@ {% block title %}Change Workout {% endblock %} +{% block scripts %} +{% include "monitorjobs.html" %} +{% endblock %} + {% block main %}
{% if workout|previousworkout:rower.user %} diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz deleted file mode 100644 index e21c31ab..00000000 Binary files a/rowers/tests/testdata/testdata.csv.gz and /dev/null differ