fix #433
This commit is contained in:
@@ -83,7 +83,7 @@ queuelow = django_rq.get_queue('low')
|
|||||||
queuehigh = django_rq.get_queue('default')
|
queuehigh = django_rq.get_queue('default')
|
||||||
|
|
||||||
from rowsandall_app.settings import SITE_URL
|
from rowsandall_app.settings import SITE_URL
|
||||||
from rowers.mytypes import otwtypes
|
from rowers.mytypes import otwtypes,otetypes
|
||||||
|
|
||||||
from rowers.database import *
|
from rowers.database import *
|
||||||
from rowers.opaque import encoder
|
from rowers.opaque import encoder
|
||||||
@@ -998,6 +998,8 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
if dosummary:
|
if dosummary:
|
||||||
summary = row.allstats()
|
summary = row.allstats()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
timezone_str = 'UTC'
|
timezone_str = 'UTC'
|
||||||
try:
|
try:
|
||||||
workoutstartdatetime = timezone.make_aware(row.rowdatetime)
|
workoutstartdatetime = timezone.make_aware(row.rowdatetime)
|
||||||
@@ -1050,6 +1052,9 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
maxhr = np.nan_to_num(maxhr)
|
maxhr = np.nan_to_num(maxhr)
|
||||||
averagehr = np.nan_to_num(averagehr)
|
averagehr = np.nan_to_num(averagehr)
|
||||||
|
|
||||||
|
dragfactor = 0
|
||||||
|
if workouttype in otetypes:
|
||||||
|
dragfactor = row.dragfactor
|
||||||
|
|
||||||
t = datetime.datetime.strptime(duration,"%H:%M:%S.%f")
|
t = datetime.datetime.strptime(duration,"%H:%M:%S.%f")
|
||||||
delta = datetime.timedelta(hours=t.hour, minutes=t.minute, seconds=t.second)
|
delta = datetime.timedelta(hours=t.hour, minutes=t.minute, seconds=t.second)
|
||||||
@@ -1079,6 +1084,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
w = Workout(user=r, name=title, date=workoutdate,
|
w = Workout(user=r, name=title, date=workoutdate,
|
||||||
workouttype=workouttype,
|
workouttype=workouttype,
|
||||||
boattype=boattype,
|
boattype=boattype,
|
||||||
|
dragfactor=dragfactor,
|
||||||
duration=duration, distance=totaldist,
|
duration=duration, distance=totaldist,
|
||||||
weightcategory=weightcategory,
|
weightcategory=weightcategory,
|
||||||
adaptiveclass=adaptiveclass,
|
adaptiveclass=adaptiveclass,
|
||||||
|
|||||||
Reference in New Issue
Block a user