Private
Public Access
1
0

Merge branch 'release/v13.15'

This commit is contained in:
Sander Roosendaal
2020-07-04 17:24:56 +02:00

View File

@@ -16,6 +16,8 @@ def howfaris(lat_lon,course):
return distance
whatisnear = 150
# get nearest races
def getnearestraces(lat_lon,races):
newlist = []
@@ -27,7 +29,7 @@ def getnearestraces(lat_lon,races):
c = race.course
coords = c.coord
distance = howfaris(lat_lon,c)
if distance < 100:
if distance < whatisnear:
newlist.append(race)
counter += 1
@@ -39,7 +41,7 @@ def getnearestraces(lat_lon,races):
orders = sorted(orders,key = lambda tup:tup[1])
ids = [id for id,distance in orders[0:4]]
for id, distance in orders[5:]:
if distance<100:
if distance<whatisnear:
ids.append(id)
for id in ids:
@@ -54,7 +56,7 @@ def getnearestcourses(lat_lon,courses):
for c in courses:
coords = c.coord
distance = howfaris(lat_lon,c)
if distance < 100:
if distance < whatisnear:
newlist.append(c)
counter += 1
@@ -65,7 +67,7 @@ def getnearestcourses(lat_lon,courses):
orders = sorted(orders,key = lambda tup:tup[1])
ids = [id for id,distance in orders[0:4]]
for id, distance in orders[5:]:
if distance<100:
if distance<whatisnear:
ids.append(id)
for id in ids:
@@ -378,7 +380,7 @@ def standard_view(request,id=0):
r = getrower(request.user)
allower = ["-referencespeed","agemax","agemin","sex","name",
allowed = ["-referencespeed","agemax","agemin","sex","name",
"referencespeed","-agemax","-agemin","-sex","-name"]
orderby = request.GET.get('order_by')
@@ -1337,7 +1339,7 @@ def virtualevent_view(request,id=0):
orderby = request.GET.get('order_by')
if orderby not in allowed:
orderby = None
if orderby is not None:
try:
results = results.order_by(orderby)