Private
Public Access
1
0

prevent users to use 0 as planned session value

This commit is contained in:
Sander Roosendaal
2018-12-07 08:56:38 +01:00
parent fcc74d0625
commit 6f4ba95337
3 changed files with 19 additions and 2 deletions

View File

@@ -327,7 +327,10 @@ def is_session_complete_ws(ws,ps):
if not completiondate and score>=cratiomin*value:
completiondate = w.date
ratio = score/float(value)
try:
ratio = score/float(value)
except ZeroDivisionError:
ratio = 0
verdict = 'better than nothing'
@@ -581,7 +584,7 @@ def get_sessions(r,startdate=date.today(),
startdate__lte=enddate,
enddate__gte=startdate,
).order_by("preferreddate","startdate","enddate").exclude(
sessiontype='race')
sessiontype='race').exclude(sessiontype='indoorrace')
return sps