Private
Public Access
1
0

finishing c2 sync

This commit is contained in:
Sander Roosendaal
2021-05-12 09:28:00 +02:00
parent 4db0c20efa
commit ae87acc14b
3 changed files with 4 additions and 4 deletions

View File

@@ -239,7 +239,7 @@ def create_async_workout(alldata,user,c2id):
try:
timezone_str = data['timezone']
except:
except: # pragma: no cover
timezone_str = 'UTC'
workoutdate = startdatetime.astimezone(

View File

@@ -3164,7 +3164,7 @@ def handle_c2_async_workout(alldata,userid,c2token,c2id,delaysec,defaulttimezone
try:
jsondata = json.load(c2blocked)
parkedids = jsondata['ids']
except JSONDecodeError:
except JSONDecodeError: # pragma: no cover
parkedids = []
newparkedids = [id for id in parkedids if id != newc2id]

View File

@@ -4814,7 +4814,7 @@ def workout_upload_api(request):
elapsedTime = post_data.get('elapsedTime',None)
summary = post_data.get('summary',None)
timezone = post_data.get('timezone',None)
r = None
if form.is_valid():
t = form.cleaned_data['title']
@@ -4905,7 +4905,7 @@ def workout_upload_api(request):
return JSONResponse(status=200,data=message)
w = Workout.objects.get(id=id)
if timezone is not None:
if timezone is not None: # pragma: no cover
w.startdatetime = w.startdatetime.astimezone(pytz.timezone(timezone))
w.workoutdate = w.startdatetime.strftime('%Y-%m-%d')
w.starttime = w.starttime.strftime('%H:%M:%S')