finishing c2 sync
This commit is contained in:
@@ -239,7 +239,7 @@ def create_async_workout(alldata,user,c2id):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
timezone_str = data['timezone']
|
timezone_str = data['timezone']
|
||||||
except:
|
except: # pragma: no cover
|
||||||
timezone_str = 'UTC'
|
timezone_str = 'UTC'
|
||||||
|
|
||||||
workoutdate = startdatetime.astimezone(
|
workoutdate = startdatetime.astimezone(
|
||||||
|
|||||||
@@ -3164,7 +3164,7 @@ def handle_c2_async_workout(alldata,userid,c2token,c2id,delaysec,defaulttimezone
|
|||||||
try:
|
try:
|
||||||
jsondata = json.load(c2blocked)
|
jsondata = json.load(c2blocked)
|
||||||
parkedids = jsondata['ids']
|
parkedids = jsondata['ids']
|
||||||
except JSONDecodeError:
|
except JSONDecodeError: # pragma: no cover
|
||||||
parkedids = []
|
parkedids = []
|
||||||
|
|
||||||
newparkedids = [id for id in parkedids if id != newc2id]
|
newparkedids = [id for id in parkedids if id != newc2id]
|
||||||
|
|||||||
@@ -4814,7 +4814,7 @@ def workout_upload_api(request):
|
|||||||
elapsedTime = post_data.get('elapsedTime',None)
|
elapsedTime = post_data.get('elapsedTime',None)
|
||||||
summary = post_data.get('summary',None)
|
summary = post_data.get('summary',None)
|
||||||
timezone = post_data.get('timezone',None)
|
timezone = post_data.get('timezone',None)
|
||||||
|
|
||||||
r = None
|
r = None
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
t = form.cleaned_data['title']
|
t = form.cleaned_data['title']
|
||||||
@@ -4905,7 +4905,7 @@ def workout_upload_api(request):
|
|||||||
return JSONResponse(status=200,data=message)
|
return JSONResponse(status=200,data=message)
|
||||||
|
|
||||||
w = Workout.objects.get(id=id)
|
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.startdatetime = w.startdatetime.astimezone(pytz.timezone(timezone))
|
||||||
w.workoutdate = w.startdatetime.strftime('%Y-%m-%d')
|
w.workoutdate = w.startdatetime.strftime('%Y-%m-%d')
|
||||||
w.starttime = w.starttime.strftime('%H:%M:%S')
|
w.starttime = w.starttime.strftime('%H:%M:%S')
|
||||||
|
|||||||
Reference in New Issue
Block a user