Merge branch 'release/v13.14'
This commit is contained in:
@@ -1868,7 +1868,7 @@ def course_map(course):
|
||||
var mymap = L.map('map_canvas', {{
|
||||
center: [{latmean}, {lonmean}],
|
||||
zoom: 13,
|
||||
layers: [streets, satellite]
|
||||
layers: [outdoors]
|
||||
}}).setView([{latmean},{lonmean}], 13);
|
||||
|
||||
var navionics = new JNC.Leaflet.NavionicsOverlay({{
|
||||
|
||||
+6
-3
@@ -25,7 +25,8 @@ import re
|
||||
import pytz
|
||||
from django_countries.fields import CountryField
|
||||
|
||||
from scipy.interpolate import splprep, splev, CubicSpline
|
||||
from scipy.interpolate import splprep, splev, CubicSpline,interp1d
|
||||
|
||||
import numpy as np
|
||||
|
||||
import shutil
|
||||
@@ -438,8 +439,10 @@ def course_spline(coordinates):
|
||||
tnew = np.linspace(0,1,100)
|
||||
|
||||
try:
|
||||
latnew = CubicSpline(t,latitudes,bc_type='clamped')(tnew)
|
||||
lonnew = CubicSpline(t,longitudes,bc_type='clamped')(tnew)
|
||||
#latnew = CubicSpline(t,latitudes,bc_type='not-a-knot')(tnew)
|
||||
#lonnew = CubicSpline(t,longitudes,bc_type='not-a-knot')(tnew)
|
||||
latnew = interp1d(t,latitudes)(tnew)
|
||||
lonnew = interp1d(t,longitudes)(tnew)
|
||||
except ValueError:
|
||||
latnew = latitudes
|
||||
lonnew = longitudes
|
||||
|
||||
@@ -378,7 +378,12 @@ def standard_view(request,id=0):
|
||||
|
||||
r = getrower(request.user)
|
||||
|
||||
allower = ["-referencespeed","agemax","agemin","sex","name",
|
||||
"referencespeed","-agemax","-agemin","-sex","-name"]
|
||||
|
||||
orderby = request.GET.get('order_by')
|
||||
if orderby not in allowed:
|
||||
orderby = None
|
||||
|
||||
if orderby is not None:
|
||||
standards = CourseStandard.objects.filter(
|
||||
@@ -1328,7 +1333,11 @@ def virtualevent_view(request,id=0):
|
||||
}
|
||||
]
|
||||
|
||||
allowed = ["duration","distance","-distance","points","-points","-duration","-distance"]
|
||||
orderby = request.GET.get('order_by')
|
||||
if orderby not in allowed:
|
||||
orderby = None
|
||||
|
||||
if orderby is not None:
|
||||
try:
|
||||
results = results.order_by(orderby)
|
||||
|
||||
Reference in New Issue
Block a user