From 5513020ea383531be1af9a0ade5c23eb8336c937 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 10:54:15 +0200
Subject: [PATCH 1/9] bug fix
---
rowers/views/planviews.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/rowers/views/planviews.py b/rowers/views/planviews.py
index 7db2babe..2de4b7a6 100644
--- a/rowers/views/planviews.py
+++ b/rowers/views/planviews.py
@@ -1967,7 +1967,11 @@ def plannedsession_view(request,id=0,userid=0):
microsecs = 0
# taking workout duration plus 1 minute penalty
- wdict['time'] = w.duration
+ wdict['time'] = datetime.timedelta(
+ hours=w.duration.hour,
+ minutes=w.duration.minute,
+ seconds=w.duration.second,
+ )
wdict['distance'] = ps.course.distance
wdict['coursecompleted'] = False
From 4b5d350d49ab3f9eb71b9669c1a69e27682f9841 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 14:19:06 +0200
Subject: [PATCH 2/9] fix #563
---
rowers/interactiveplots.py | 1 +
rowers/views/analysisviews.py | 8 +++-----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py
index 0ea08a8b..be22200f 100644
--- a/rowers/interactiveplots.py
+++ b/rowers/interactiveplots.py
@@ -193,6 +193,7 @@ def interactive_hr_piechart(df,rower,title,totalseconds=0):
qry = 'hr < {ut2}'.format(ut2=rower.ut2)
frac_lut2 = totalseconds*df.query(qry)['deltat'].sum()/sumtimehr
+
qry = '{ut2} <= hr < {ut1}'.format(ut1=rower.ut1,ut2=rower.ut2)
frac_ut2 = totalseconds*df.query(qry)['deltat'].sum()/sumtimehr
diff --git a/rowers/views/analysisviews.py b/rowers/views/analysisviews.py
index b02a7cb9..15de14d7 100644
--- a/rowers/views/analysisviews.py
+++ b/rowers/views/analysisviews.py
@@ -4721,7 +4721,6 @@ def history_view(request,userid=0):
totalmeters,totalhours, totalminutes, totalseconds = get_totals(g_workouts)
-
# meters, duration per workout type
wtypes = list(set([w.workouttype for w in g_workouts]))
@@ -4860,14 +4859,13 @@ def history_view_data(request,userid=0):
df = getsmallrowdata_db(columns,ids=ids)
try:
- df['deltat'] = df['time'].diff()
+ df['deltat'] = df['time'].diff().clip(lower=0)
except KeyError:
pass
df = dataprep.clean_df_stats(df,workstrokesonly=True,
ignoreadvanced=True,ignorehr=False)
totalmeters,totalhours, totalminutes,totalseconds = get_totals(g_workouts)
-
# meters, duration per workout type
wtypes = list(set([w.workouttype for w in g_workouts]))
@@ -4895,7 +4893,7 @@ def history_view_data(request,userid=0):
)
ddf = getsmallrowdata_db(columns,ids=[w.id for w in a_workouts])
try:
- ddf['deltat'] = ddf['time'].diff()
+ ddf['deltat'] = ddf['time'].diff().clip(lower=0)
except KeyError:
pass
ddf = dataprep.clean_df_stats(ddf,workstrokesonly=True,
@@ -4944,7 +4942,7 @@ def history_view_data(request,userid=0):
totalseconds = 3600*hours+60*minutes+seconds
ddf = getsmallrowdata_db(columns,ids=[w.id for w in a_workouts])
try:
- ddf['deltat'] = ddf['time'].diff()
+ ddf['deltat'] = ddf['time'].diff().clip(lower=0)
except KeyError:
pass
ddf = dataprep.clean_df_stats(ddf,workstrokesonly=True,
From 30a3602774af0ae06d3550dd81b0d3049be08239 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 15:32:13 +0200
Subject: [PATCH 3/9] fixes
---
rowers/plannedsessions.py | 4 ++--
rowers/tasks.py | 14 +++++++++++++-
rowers/views/racesviews.py | 4 +++-
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py
index 709ccf1d..eb2af21c 100644
--- a/rowers/plannedsessions.py
+++ b/rowers/plannedsessions.py
@@ -1385,7 +1385,7 @@ def default_class(r,w,race):
adaptiveclass=adaptiveclass,
boattype=boattype,
).order_by(
- "agemax","-agemin","boattype","sex","weightcategory",
+ "agemax","-agemin","boattype","sex","weightclass",
"referencespeed"
)
if standards.count()==0:
@@ -1394,7 +1394,7 @@ def default_class(r,w,race):
boattype=boattype
).order_by(
"agemax","-agemin","boattype","sex",
- "weightcategory","referencespeed")
+ "weightclass","referencespeed")
if standards.count()==0:
standards = CourseStandard.objects.filter(
agemin__lt=age,agemax__gt=age
diff --git a/rowers/tasks.py b/rowers/tasks.py
index 26ef86e3..4363f7f6 100644
--- a/rowers/tasks.py
+++ b/rowers/tasks.py
@@ -587,13 +587,25 @@ def handle_check_race_course(self,
endsecond=endsecond,
)
-
with engine.connect() as conn, conn.begin():
result = conn.execute(query)
conn.close()
engine.dispose()
+ # add times for all gates to log file
+ with open(logfile,'a') as f:
+ t = time.localtime()
+ f.write('\n')
+ f.write(timestamp)
+ f.write(' ')
+ f.write('--- LOG of all gate times---')
+
+ for path,polygon in (paths,polygons):
+ ( secs,meters,completed) = coursetime_paths(rowdata2,
+ [path],[polygon],logfile=logfile)
+
+
# send email
handle_sendemail_coursefail(
useremail,userfirstname,logfile
diff --git a/rowers/views/racesviews.py b/rowers/views/racesviews.py
index a68ef3ba..cb12d553 100644
--- a/rowers/views/racesviews.py
+++ b/rowers/views/racesviews.py
@@ -3277,6 +3277,7 @@ def virtualevent_entry_edit_view(request,id=0,entryid=0):
if form.is_valid():
cd = form.cleaned_data
+
teamname = cd['teamname']
try:
boattype = cd['boattype']
@@ -3293,12 +3294,12 @@ def virtualevent_entry_edit_view(request,id=0,entryid=0):
acceptsocialmedia = cd['acceptsocialmedia']
sex = r.sex
+
if mix:
sex = 'mixed'
if boattype == '1x' and r.birthdate:
age = calculate_age(r.birthdate)
- sex = r.sex
if sex == 'not specified':
sex = 'male'
@@ -3328,6 +3329,7 @@ def virtualevent_entry_edit_view(request,id=0,entryid=0):
messages.error(request,'You are older than the maximum age for this group')
return HttpResponseRedirect(returnurl)
+ print(sex,coursestandard.sex)
if sex == 'male' and coursestandard.sex != 'male':
messages.error(request,'Men are not allowed to enter this category')
return HttpResponseRedirect(returnurl)
From 001cf555913769909bc8bd97d8f44af3c78808c7 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 17:43:45 +0200
Subject: [PATCH 4/9] adding extra log
---
rowers/courseutils.py | 4 ++--
rowers/tasks.py | 16 +++++++++-------
rowers/views/importviews.py | 31 ++++++++++++-------------------
3 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/rowers/courseutils.py b/rowers/courseutils.py
index d864e372..1badc1fa 100644
--- a/rowers/courseutils.py
+++ b/rowers/courseutils.py
@@ -41,7 +41,7 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
if logfile is not None:
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
- with open(logfile,'a') as f:
+ with open(logfile,'ab') as f:
f.write('\n')
f.write(timestamp)
f.write(' ')
@@ -65,7 +65,7 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
if logfile is not None:
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
- with open(logfile,'a') as f:
+ with open(logfile,'ab') as f:
f.write('\n')
f.write(timestamp)
f.write(' ')
diff --git a/rowers/tasks.py b/rowers/tasks.py
index 4363f7f6..b30bfd2f 100644
--- a/rowers/tasks.py
+++ b/rowers/tasks.py
@@ -198,7 +198,7 @@ def handle_strava_sync(stravatoken,workoutid,filename,name,activity_type,descrip
e = sys.exc_info()[0]
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
- with open('stravalog.log','a') as f:
+ with open('stravalog.log','ab') as f:
f.write('\n')
f.write(timestamp)
f.write(str(e))
@@ -446,7 +446,7 @@ def handle_check_race_course(self,
try:
entrytimes,entrydistances = time_in_path(rowdata,paths[0],maxmin='max',getall=True,
name=polygons[0].name,logfile=logfile)
- with open(logfile,'a') as f:
+ with open(logfile,'ab') as f:
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
f.write('\n')
@@ -471,7 +471,7 @@ def handle_check_race_course(self,
endseconds = []
for startt in entrytimes:
- with open(logfile,'a') as f:
+ with open(logfile,'ab') as f:
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
f.write('\n')
@@ -594,17 +594,19 @@ def handle_check_race_course(self,
engine.dispose()
# add times for all gates to log file
- with open(logfile,'a') as f:
+ with open(logfile,'ab') as f:
t = time.localtime()
f.write('\n')
f.write(timestamp)
f.write(' ')
f.write('--- LOG of all gate times---')
- for path,polygon in (paths,polygons):
+ for path,polygon in zip(paths,polygons):
( secs,meters,completed) = coursetime_paths(rowdata2,
- [path],[polygon],logfile=logfile)
-
+ [path],polygons=[polygon],logfile=logfile)
+ with open(logfile,'ab') as f:
+ line = " time: {t} seconds, distance: {m} meters".format(t=secs,m=meters)
+ f.write(line)
# send email
handle_sendemail_coursefail(
diff --git a/rowers/views/importviews.py b/rowers/views/importviews.py
index 10573f7f..a512eca1 100644
--- a/rowers/views/importviews.py
+++ b/rowers/views/importviews.py
@@ -1036,26 +1036,19 @@ def garmin_deregistration_view(request):
if request.method != 'POST':
return HttpResponse(status=200)
- t = time.localtime()
- timestamp = time.strftime('%b-%d-%Y_%H%M', t)
- with open('garminlog.log','a') as f:
- f.write('\n')
- f.write(timestamp)
- f.write(' ')
- f.write(str(request.body))
-
data = json.loads(request.body)
- try:
- garmintoken = data['userAccessToken']
- except KeyError:
- print(data)
- return HttpResponse(status=200)
- try:
- r = Rower.objects.get(garmintoken=garmintoken)
- r.garmintoken = ''
- r.save()
- except Rower.DoesNotExist:
- return HttpResponse(status=200)
+ deregistrations = data['deregistrations']
+ for deregistration in deregistrations:
+ try:
+ garmintoken = deregistration['userAccessToken']
+ try:
+ r = Rower.objects.get(garmintoken=garmintoken)
+ r.garmintoken = ''
+ r.save()
+ except Rower.DoesNotExist:
+ pass
+ except KeyError:
+ pass
return HttpResponse(status=200)
From 6a655960e5293cce9c4655f18a40eb5914f926e5 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 18:15:31 +0200
Subject: [PATCH 5/9] better logging
---
rowers/courseutils.py | 50 +++++++++++++++++++++----------------------
rowers/tasks.py | 33 ++++++++++++++--------------
2 files changed, 41 insertions(+), 42 deletions(-)
diff --git a/rowers/courseutils.py b/rowers/courseutils.py
index 1badc1fa..32b38eb1 100644
--- a/rowers/courseutils.py
+++ b/rowers/courseutils.py
@@ -40,23 +40,23 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
if len(df[b==2]):
if logfile is not None:
t = time.localtime()
- timestamp = time.strftime('%b-%d-%Y_%H%M', t)
+ timestamp = bytes('{t}'.format(t=time.strftime('%b-%d-%Y_%H%M', t)),'utf-8')
with open(logfile,'ab') as f:
- f.write('\n')
+ f.write(b'\n')
f.write(timestamp)
- f.write(' ')
- f.write(name)
- f.write(' ')
- f.write(maxmin)
- f.write(' ')
- f.write(str(getall))
- f.write(' ')
- f.write(str(len(df[b==2])))
- f.write(' ')
+ f.write(b' ')
+ f.write(bytes(name,'utf-8'))
+ f.write(b' ')
+ f.write(bytes(maxmin,'utf-8'))
+ f.write(b' ')
+ f.write(bytes(str(getall),'utf-8'))
+ f.write(b' ')
+ f.write(bytes(str(len(df[b==2])),'utf-8'))
+ f.write(b' ')
if len(df[b==2])>1:
- f.write(' passes found')
+ f.write(b' passes found')
else:
- f.write(' pass found')
+ f.write(b' pass found')
if getall:
return df[b==2]['time'],df[b==2]['cum_dist']
else:
@@ -64,20 +64,20 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
if logfile is not None:
t = time.localtime()
- timestamp = time.strftime('%b-%d-%Y_%H%M', t)
+ timestamp = bytes('{t}'.format(t=time.strftime('%b-%d-%Y_%H%M', t)),'utf-8')
with open(logfile,'ab') as f:
- f.write('\n')
+ f.write(b'\n')
f.write(timestamp)
- f.write(' ')
- f.write(name)
- f.write(' ')
- f.write(maxmin)
- f.write(' ')
- f.write(str(getall))
- f.write(' ')
- f.write(str(len(df[b==2])))
- f.write(' ')
- f.write(' pass not found')
+ f.write(b' ')
+ f.write(bytes(name,'utf-8'))
+ f.write(b' ')
+ f.write(bytes(maxmin,'utf-8'))
+ f.write(b' ')
+ f.write(bytes(str(getall),'utf-8'))
+ f.write(b' ')
+ f.write(bytes(str(len(df[b==2])),'utf-8'))
+ f.write(b' ')
+ f.write(b' pass not found')
raise InvalidTrajectoryError("Trajectory doesn't go through path")
diff --git a/rowers/tasks.py b/rowers/tasks.py
index b30bfd2f..e83d08c3 100644
--- a/rowers/tasks.py
+++ b/rowers/tasks.py
@@ -197,9 +197,9 @@ def handle_strava_sync(stravatoken,workoutid,filename,name,activity_type,descrip
except:
e = sys.exc_info()[0]
t = time.localtime()
- timestamp = time.strftime('%b-%d-%Y_%H%M', t)
+ timestamp = bytes('{t}'.format(t=time.strftime('%b-%d-%Y_%H%M', t)),'utf-8')
with open('stravalog.log','ab') as f:
- f.write('\n')
+ f.write(b'\n')
f.write(timestamp)
f.write(str(e))
@@ -448,13 +448,13 @@ def handle_check_race_course(self,
name=polygons[0].name,logfile=logfile)
with open(logfile,'ab') as f:
t = time.localtime()
- timestamp = time.strftime('%b-%d-%Y_%H%M', t)
- f.write('\n')
- f.write('Course id {n}, Record id {m}'.format(n=courseid,m=recordid))
- f.write('\n')
+ timestamp = bytes('{t}'.format(t=time.strftime('%b-%d-%Y_%H%M', t)),'utf-8')
+ f.write(b'\n')
+ f.write(bytes('Course id {n}, Record id {m}'.format(n=courseid,m=recordid),'utf-8'))
+ f.write(b'\n')
f.write(timestamp)
- f.write(' ')
- f.write('Found {n} entrytimes'.format(n=len(entrytimes)))
+ f.write(b' ')
+ f.write(bytes('Found {n} entrytimes'.format(n=len(entrytimes)),'utf-8'))
except InvalidTrajectoryError:
entrytimes = []
@@ -473,11 +473,11 @@ def handle_check_race_course(self,
for startt in entrytimes:
with open(logfile,'ab') as f:
t = time.localtime()
- timestamp = time.strftime('%b-%d-%Y_%H%M', t)
- f.write('\n')
+ timestamp = bytes('{t}'.format(t=time.strftime('%b-%d-%Y_%H%M', t)),'utf-8')
+ f.write(b'\n')
f.write(timestamp)
- f.write(' ')
- f.write('Path starting at {t}'.format(t=startt))
+ f.write(b' ')
+ f.write(bytes('Path starting at {t}'.format(t=startt),'utf-8'))
rowdata2 = rowdata[rowdata['time']>(startt-10.)]
(
@@ -596,17 +596,16 @@ def handle_check_race_course(self,
# add times for all gates to log file
with open(logfile,'ab') as f:
t = time.localtime()
- f.write('\n')
- f.write(timestamp)
- f.write(' ')
- f.write('--- LOG of all gate times---')
+ f.write(b'\n')
+ f.write(b' ')
+ f.write(b'--- LOG of all gate times---')
for path,polygon in zip(paths,polygons):
( secs,meters,completed) = coursetime_paths(rowdata2,
[path],polygons=[polygon],logfile=logfile)
with open(logfile,'ab') as f:
line = " time: {t} seconds, distance: {m} meters".format(t=secs,m=meters)
- f.write(line)
+ f.write(bytes(line,'utf-8'))
# send email
handle_sendemail_coursefail(
From 29dc0786b86023d0e2838fe6c8279fff6c2d339c Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 19:23:09 +0200
Subject: [PATCH 6/9] fix bug race registration
---
rowers/garmin_stuff.py | 1 -
rowers/plannedsessions.py | 1 +
rowers/tests/test_imports.py | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rowers/garmin_stuff.py b/rowers/garmin_stuff.py
index 9e9502a1..3ce43ebf 100644
--- a/rowers/garmin_stuff.py
+++ b/rowers/garmin_stuff.py
@@ -135,7 +135,6 @@ def garmin_getworkout(garminid,r,activity):
offset = activity['startTimeOffsetInSeconds']
except KeyError:
offset = 0
- print(offset)
durationseconds = activity['durationInSeconds']
duration = dataprep.totaltime_sec_to_string(durationseconds)
activitytype = activity['activityType']
diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py
index eb2af21c..83c68a7a 100644
--- a/rowers/plannedsessions.py
+++ b/rowers/plannedsessions.py
@@ -1639,6 +1639,7 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0,doregister=False):
entrycategory=initialcategory,
)
record.save()
+ add_rower_race(r,race)
else:
errors.append("Unable to find a suitable start category")
return result,comments,errors,0
diff --git a/rowers/tests/test_imports.py b/rowers/tests/test_imports.py
index 3abb8944..ef9e3935 100644
--- a/rowers/tests/test_imports.py
+++ b/rowers/tests/test_imports.py
@@ -109,7 +109,7 @@ class GarminObjects(DjangoTestCase):
self.assertEqual(len(data),2)
def test_garmin_deregistration(self):
- data = {"userAccessToken":"dfdzf"}
+ data = {"deregistrations":[{"userAccessToken":"dfdzf"}]}
response = self.c.post('/rowers/garmin/deregistration/',json.dumps(data),
content_type='application/json')
From b1f59c51c4a637f4ffa2e990b4c195a8dc6d3ea0 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 22:22:43 +0200
Subject: [PATCH 7/9] adding ref speed
---
rowers/plannedsessions.py | 10 ++++++----
rowers/views/racesviews.py | 7 ++++---
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py
index 83c68a7a..fd54565c 100644
--- a/rowers/plannedsessions.py
+++ b/rowers/plannedsessions.py
@@ -1404,12 +1404,12 @@ def default_class(r,w,race):
if standards.count()==0:
# boolean, boattype, boatclass, adaptiveclass, weightclass, sex, coursestandard,
- return False,'1x','water',None,'hwt','male',None
+ return False,'1x','water',None,'hwt','male',5.0,None
if standards.count()>0:
# find optimum standard
s = standards[0]
- return True,s.boattype,s.boatclass,s.adaptiveclass,s.weightclass,s.sex,s
+ return True,s.boattype,s.boatclass,s.adaptiveclass,s.weightclass,s.sex,s.referencespeed,s
# No Course Standard
return True,boattype,boatclass,adaptiveclass,weightclass,sex,None
@@ -1472,7 +1472,7 @@ def add_workout_indoorrace(ws,race,r,recordid=0,doregister=False):
)
except IndoorVirtualRaceResult.DoesNotExist:
if doregister:
- hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,initialcategory = default_class(r,ws[0],race)
+ hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,referencespeed,initialcategory = default_class(r,ws[0],race)
if hasinitial:
record = IndoorVirtualRaceResult(
userid = r.id,
@@ -1483,6 +1483,7 @@ def add_workout_indoorrace(ws,race,r,recordid=0,doregister=False):
boatclass=boatclass,
sex=sex,
age = age,
+ referencespeed=referencespeed,
entrycategory=initialcategory,
)
record.save()
@@ -1624,7 +1625,7 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0,doregister=False):
)
except VirtualRaceResult.DoesNotExist:
if doregister:
- hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,initialcategory = default_class(r,ws[0],race)
+ hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,referencespeed,initialcategory = default_class(r,ws[0],race)
if hasinitial:
record = VirtualRaceResult(
userid = r.id,
@@ -1637,6 +1638,7 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0,doregister=False):
sex=sex,
age = age,
entrycategory=initialcategory,
+ referencespeed=referencespeed,
)
record.save()
add_rower_race(r,race)
diff --git a/rowers/views/racesviews.py b/rowers/views/racesviews.py
index cb12d553..8fd04b04 100644
--- a/rowers/views/racesviews.py
+++ b/rowers/views/racesviews.py
@@ -1631,7 +1631,7 @@ def virtualevent_addboat_view(request,id=0):
raise Http404("Virtual Challenge does not exist")
categories = None
- hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,initialcategory = default_class(r,None,race)
+ hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,referencespeed,initialcategory = default_class(r,None,race)
if race.coursestandards is not None:
categories = CourseStandard.objects.filter(
standardcollection=race.coursestandards).order_by("name")
@@ -1918,7 +1918,7 @@ def virtualevent_register_view(request,id=0):
raise Http404("Virtual Challenge does not exist")
categories = None
- hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,initialcategory = default_class(r,None,race)
+ hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,referencespeed,initialcategory = default_class(r,None,race)
if race.coursestandards is not None:
categories = CourseStandard.objects.filter(
standardcollection=race.coursestandards).order_by("name")
@@ -2943,7 +2943,7 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
)
if records.count() == 0:
- hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,initialcategory = default_class(r,None,race)
+ hasinitial,boattype,boatclass,adaptiveclass,weightclass,sex,referencespeed,initialcategory = default_class(r,None,race)
if not hasinitial:
messages.error(request,"Sorry, you have to register first")
url = reverse('virtualevent_view',
@@ -2961,6 +2961,7 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
sex=sex,
age=calculate_age(r.birthdate),
entrycategory=initialcategory,
+ referencespeed=referencespeed,
)
record.save()
records = [record]
From 9eb7d3837e2c33de9fb355497cd3945846d5cb11 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 22:25:33 +0200
Subject: [PATCH 8/9] commenting out G
---
rowers/templates/rower_exportsettings.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rowers/templates/rower_exportsettings.html b/rowers/templates/rower_exportsettings.html
index 8e7f66d2..69a6bc40 100644
--- a/rowers/templates/rower_exportsettings.html
+++ b/rowers/templates/rower_exportsettings.html
@@ -34,10 +34,11 @@
alt="connect with Polar" width="130">

+
{% endblock %}
From ae7eb963b025a29d23d6e201495fdddc368d1c94 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Tue, 7 Jul 2020 22:31:08 +0200
Subject: [PATCH 9/9] bug fix
---
rowers/plannedsessions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py
index fd54565c..326b02d3 100644
--- a/rowers/plannedsessions.py
+++ b/rowers/plannedsessions.py
@@ -1412,7 +1412,7 @@ def default_class(r,w,race):
return True,s.boattype,s.boatclass,s.adaptiveclass,s.weightclass,s.sex,s.referencespeed,s
# No Course Standard
- return True,boattype,boatclass,adaptiveclass,weightclass,sex,None
+ return True,boattype,boatclass,adaptiveclass,weightclass,sex,5.0,None