Private
Public Access
1
0

some small fixes

This commit is contained in:
Sander Roosendaal
2021-05-22 13:51:48 +02:00
parent f321d10021
commit d338f67436

View File

@@ -25,6 +25,8 @@ from rowingdata import rowingdata as rdata
from datetime import timedelta
from sqlalchemy import create_engine
from simplejson.errors import JSONDecodeError
#from celery import app
from rowers.celery import app
from celery import shared_task
@@ -2846,7 +2848,10 @@ def handle_rp3_async_workout(userid,rp3token,rp3id,startdatetime,max_attempts,de
if response.status_code != 200: # pragma: no cover
have_link = True
workout_download_details = pd.json_normalize(response.json()['data']['download'])
try:
workout_download_details = pd.json_normalize(response.json()['data']['download'])
except JSONDecodeError:
return 0
if workout_download_details.iat[0,1] == 'ready':
download_url = workout_download_details.iat[0,2]
@@ -3035,7 +3040,7 @@ def handle_c2_async_workout(alldata,userid,c2token,c2id,delaysec,defaulttimezone
try:
timezone = pytz.timezone(data['timezone'])
except UnknownTimeZoneError:
timezone = 'UTC'
timezone = pytz.utc
startdatetime = startdatetime.astimezone(timezone)
s = 'Time zone {timezone}, stardatetime {startdatetime}, duration {duration}'.format(