Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2018-05-15 15:10:32 +02:00
parent 360c0a1a16
commit 80b821a41d

View File

@@ -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