some small fixes
This commit is contained in:
@@ -25,6 +25,8 @@ from rowingdata import rowingdata as rdata
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from sqlalchemy import create_engine
|
from sqlalchemy import create_engine
|
||||||
|
|
||||||
|
from simplejson.errors import JSONDecodeError
|
||||||
|
|
||||||
#from celery import app
|
#from celery import app
|
||||||
from rowers.celery import app
|
from rowers.celery import app
|
||||||
from celery import shared_task
|
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
|
if response.status_code != 200: # pragma: no cover
|
||||||
have_link = True
|
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':
|
if workout_download_details.iat[0,1] == 'ready':
|
||||||
download_url = workout_download_details.iat[0,2]
|
download_url = workout_download_details.iat[0,2]
|
||||||
@@ -3035,7 +3040,7 @@ def handle_c2_async_workout(alldata,userid,c2token,c2id,delaysec,defaulttimezone
|
|||||||
try:
|
try:
|
||||||
timezone = pytz.timezone(data['timezone'])
|
timezone = pytz.timezone(data['timezone'])
|
||||||
except UnknownTimeZoneError:
|
except UnknownTimeZoneError:
|
||||||
timezone = 'UTC'
|
timezone = pytz.utc
|
||||||
startdatetime = startdatetime.astimezone(timezone)
|
startdatetime = startdatetime.astimezone(timezone)
|
||||||
|
|
||||||
s = 'Time zone {timezone}, stardatetime {startdatetime}, duration {duration}'.format(
|
s = 'Time zone {timezone}, stardatetime {startdatetime}, duration {duration}'.format(
|
||||||
|
|||||||
Reference in New Issue
Block a user