Merge branch 'feature/alertfix' into develop
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,6 +27,7 @@ conftest.py
|
|||||||
# temporary test files
|
# temporary test files
|
||||||
/rowers/tests/testdata/temp
|
/rowers/tests/testdata/temp
|
||||||
/rowers/tests/testdata/testdata.csv.gz
|
/rowers/tests/testdata/testdata.csv.gz
|
||||||
|
rowers/tests/testdata/testdata.csv.gz
|
||||||
/rowers/tests/testdata/testdata.tcx
|
/rowers/tests/testdata/testdata.tcx
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Command(BaseCommand):
|
|||||||
else:
|
else:
|
||||||
testing = False
|
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:
|
for alert in todaysalerts:
|
||||||
stats = alerts.alert_get_stats(alert)
|
stats = alerts.alert_get_stats(alert)
|
||||||
|
|||||||
@@ -529,9 +529,14 @@ def add_workout_from_data(user,importid,data,strokedata,
|
|||||||
try:
|
try:
|
||||||
latcoord = strokedata.loc[:,'lat']
|
latcoord = strokedata.loc[:,'lat']
|
||||||
loncoord = strokedata.loc[:,'lon']
|
loncoord = strokedata.loc[:,'lon']
|
||||||
|
if latcoord.std() == 0 and loncoord.std() == 0 and workouttype == 'water':
|
||||||
|
workouttype = 'rower'
|
||||||
except:
|
except:
|
||||||
latcoord = np.zeros(nr_rows)
|
latcoord = np.zeros(nr_rows)
|
||||||
loncoord = np.zeros(nr_rows)
|
loncoord = np.zeros(nr_rows)
|
||||||
|
if workouttype == 'water':
|
||||||
|
workouttype = 'rower'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -747,12 +752,18 @@ def handle_strava_import_stroke_data(title,
|
|||||||
try:
|
try:
|
||||||
lat = coords[:,0]
|
lat = coords[:,0]
|
||||||
lon = coords[:,1]
|
lon = coords[:,1]
|
||||||
|
if lat.std() == 0 and lon.std() == 0 and workouttype == 'water':
|
||||||
|
workouttype = 'rower'
|
||||||
except IndexError:
|
except IndexError:
|
||||||
lat = np.zeros(len(t))
|
lat = np.zeros(len(t))
|
||||||
lon = np.zeros(len(t))
|
lon = np.zeros(len(t))
|
||||||
|
if workouttype == 'water':
|
||||||
|
workouttype = 'rower'
|
||||||
else:
|
else:
|
||||||
lat = np.zeros(len(t))
|
lat = np.zeros(len(t))
|
||||||
lon = np.zeros(len(t))
|
lon = np.zeros(len(t))
|
||||||
|
if workouttype == 'water':
|
||||||
|
workouttype = 'rower'
|
||||||
|
|
||||||
strokelength = velo*60./(spm)
|
strokelength = velo*60./(spm)
|
||||||
strokelength[np.isinf(strokelength)] = 0.0
|
strokelength[np.isinf(strokelength)] = 0.0
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user