Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2020-07-16 22:28:59 +02:00
parent 4b192addf2
commit 7ed48f3aa7
3 changed files with 12 additions and 4 deletions

View File

@@ -353,7 +353,10 @@ def create_async_workout(alldata,user,stravaid,debug=False):
from rowers.utils import get_strava_stream
def async_get_workout(user,stravaid):
token = strava_open(user)
try:
token = strava_open(user)
except NoTokenError:
return 0
csvfilename = 'media/{code}_{stravaid}.csv'.format(code=uuid4().hex[:16],stravaid=stravaid)
job = myqueue(queue,
fetch_strava_workout,

View File

@@ -698,8 +698,12 @@ def handle_get_garmin_file(client_id,
regex = '.*\?id=(\d+)'
m = re.compile(regex).match(url).group(1)
garminid = int(m)
try:
m = re.compile(regex).match(url).group(1)
garminid = int(m)
except AttributeError:
garminid = ''
garmin = OAuth1Session(client_id,
client_secret=client_secret,

View File

@@ -535,10 +535,11 @@ def do_sync(w,options, quick=False):
pass
try:
if options['garmind'] != 0 and options['garminid'] != '':
if options['garminid'] != 0 and options['garminid'] != '':
w.uploadedtogarmin = options['garminid']
w.save()
except KeyError:
print('keyerror')
pass