Private
Public Access
1
0

Merge branch 'release/v18.9.20'

This commit is contained in:
Sander Roosendaal
2023-02-08 21:37:37 +01:00
2 changed files with 10 additions and 2 deletions

View File

@@ -309,7 +309,8 @@ class PowerZonesField(models.TextField):
return self.get_deb_prep_value(value)
c2url = 'http://www.concept2.com/indoor-rowers/racing/records/world?machine=1&event=All&gender=All&age=All&weight=All'
#c2url = 'http://www.concept2.com/indoor-rowers/racing/records/world?machine=1&event=All&gender=All&age=All&weight=All'
c2url = 'https://www.concept2.com/indoor-rowers/racing/records/world?machine=rower&event=&gender=&age_category=&weight_class=&adaptive=0&op=Search&form_id=concept2_record_search_form#results'
def update_records(url=c2url, verbose=True):
@@ -349,7 +350,10 @@ def update_records(url=c2url, verbose=True):
sex = row.Gender
name = row.Name
age = int(row.Age)
distance = int(row.Distance)
try:
distance = int(row.Distance)
except ValueError:
distance = int(row.Distance.replace(',', ''))
duration = float(row.Duration)
season = int(row.Season)

View File

@@ -198,13 +198,17 @@ def do_sync(w, options, quick=False):
return 0
if do_c2_export: # pragma: no cover
dologging('c2_log.log','Exporting workout to C2 for user {user}'.format(user=w.user.user.id))
try:
message, id = c2stuff.workout_c2_upload(
w.user.user, w, asynchron=True)
dologging('c2_log.log','C2 upload succeeded')
except NoTokenError:
id = 0
message = "Something went wrong with the Concept2 sync"
dologging('c2_log.log','C2 no token error')
except: # pragma: no cover
dologging('c2_log.log','Error C2')
pass
if do_strava_export: # pragma: no cover