added zerodivision test in consistency checks
This commit is contained in:
@@ -442,16 +442,18 @@ def save_workout_database(f2,r,dosmooth=True,workouttype='rower',
|
|||||||
pass
|
pass
|
||||||
return new_workout_from_df(r,newdf,
|
return new_workout_from_df(r,newdf,
|
||||||
title=title)
|
title=title)
|
||||||
|
try:
|
||||||
checks = row.check_consistency()
|
checks = row.check_consistency()
|
||||||
allchecks = 1
|
allchecks = 1
|
||||||
for key,value in checks.iteritems():
|
for key,value in checks.iteritems():
|
||||||
if not value:
|
if not value:
|
||||||
allchecks = 0
|
allchecks = 0
|
||||||
if consistencychecks:
|
if consistencychecks:
|
||||||
a_messages.error(r.user,'Failed consistency check: '+key+', autocorrected')
|
a_messages.error(r.user,'Failed consistency check: '+key+', autocorrected')
|
||||||
else:
|
else:
|
||||||
a_messages.error(r.user,'Failed consistency check: '+key+', not corrected')
|
a_messages.error(r.user,'Failed consistency check: '+key+', not corrected')
|
||||||
|
except ZeroDivisionError:
|
||||||
|
pass
|
||||||
|
|
||||||
if not allchecks and consistencychecks:
|
if not allchecks and consistencychecks:
|
||||||
# row.repair()
|
# row.repair()
|
||||||
|
|||||||
Reference in New Issue
Block a user