Commit d29b5555 authored by Klaus-Uwe Mitterer's avatar Klaus-Uwe Mitterer

Fix access

parent 43110f8d
......@@ -123,16 +123,16 @@ def application(env, re):
yield "device is required.".encode()
return
on = args["on"] if "on" in args else None
frm = on if on else args["from"] if "from" in args else None
to = on if on else args["to"] if "to" in args else None
on = args["on"][0] if "on" in args else None
frm = on if on else args["from"][0] if "from" in args else None
to = on if on else args["to"][0] if "to" in args else None
frm = frm or datetime.datetime.now().strftime('%Y-%m-%d')
to = to or datetime.datetime.now().strftime('%Y-%m-%d')
for time in frm, to:
try:
datetime.strptime(time, "%Y-%m-%d")
datetime.datetime.strptime(time, "%Y-%m-%d")
except:
re("400 Bad Request", [])
yield "<h1>400 Bad Request</h1>".encode()
......@@ -177,7 +177,7 @@ def application(env, re):
"""
for row in cur.fetchall():
output += " [ %s, %s ],\n" % (lat, lon)
output += " [ %s, %s ],\n" % (row["lat"], row["lon"])
output = "".join(output.rsplit(",", 1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment