Allow latitude and longitude to be passed using a decimal comma

This commit is contained in:
Klaus-Uwe Mitterer 2017-09-28 20:49:57 +02:00
parent d43138016c
commit 308f30d223
2 changed files with 3 additions and 3 deletions

View File

@ -130,8 +130,8 @@ def application(env, re):
elif rtype.lower() in ["closest", "close", "near", "nearby"]:
try:
lat = float(args["lat"][0])
lon = float(args["lon"][0])
lat = float(args["lat"][0].replace(",", "."))
lon = float(args["lon"][0].replace(",", "."))
if (not lat and not lat == float(0)) or (not lon and not lon == float(0)):
raise ValueError()

View File

@ -135,7 +135,7 @@ def worker(frm, to, count = 3, time = datetime.datetime.now(pytz.timezone("Europ
"""
for i in range(len(conns)):
output += (conns[i].xml(1) + "\n") if not json else (conns[i].json(2) + ("\n" if i == len(conns) - 1 else ",\n"))
output += (conns[i].xml(1, i) + "\n") if not json else (conns[i].json(2, i) + ("\n" if i == len(conns) - 1 else ",\n"))
output += "</connections>" if not json else " ]\n}"