bug fix
This commit is contained in:
@@ -833,7 +833,7 @@ def cp_from_workoutids(workoutids,debug=False):
|
|||||||
|
|
||||||
if df.empty:
|
if df.empty:
|
||||||
# change this
|
# change this
|
||||||
return 2
|
return 0,0,0
|
||||||
|
|
||||||
# df is not empty. We continue
|
# df is not empty. We continue
|
||||||
dfgrouped = df.groupby(['workoutid'])
|
dfgrouped = df.groupby(['workoutid'])
|
||||||
@@ -910,6 +910,8 @@ def handle_updatefitnessmetric(user_id,mode,workoutids,debug=False,
|
|||||||
|
|
||||||
powerfourmin,power2k,powerhour = cp_from_workoutids(workoutids,debug=debug)
|
powerfourmin,power2k,powerhour = cp_from_workoutids(workoutids,debug=debug)
|
||||||
|
|
||||||
|
if powerfourmin > 0 and power2k > 0 and powerhour > 0:
|
||||||
|
|
||||||
mdict = {
|
mdict = {
|
||||||
'user_id': user_id,
|
'user_id': user_id,
|
||||||
'PowerFourMin': powerfourmin,
|
'PowerFourMin': powerfourmin,
|
||||||
@@ -921,6 +923,8 @@ def handle_updatefitnessmetric(user_id,mode,workoutids,debug=False,
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = fitnessmetric_to_sql(mdict,debug=debug,doclean=True)
|
result = fitnessmetric_to_sql(mdict,debug=debug,doclean=True)
|
||||||
|
else:
|
||||||
|
result = 0
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user