prevent users to use 0 as planned session value
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user