Fixing JSON parsing
This commit is contained in:
parent
b15d5d1b3b
commit
c10276ced4
|
|
@ -177,7 +177,9 @@
|
|||
}
|
||||
|
||||
function importGTFS() {
|
||||
imported_data = JSON.parse('{{ data }}');
|
||||
stops = JSON.parse('{{ stops|safe }}');
|
||||
routes = JSON.parse('{{ routes|safe }}')
|
||||
timetable = JSON.parse('{{ timetable|safe }}')
|
||||
alert("Import existing GTFS clicked");
|
||||
// Logic to import existing GTFS would go here
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,6 @@ def index(request):
|
|||
timetable = get_timetable(r, trips, stop_sequences)
|
||||
except Route.DoesNotExist:
|
||||
print(f"Invalid request for Route with id {request.GET['timetable']}")
|
||||
context = {"data": json.dumps({"stops": stops, "routes": routes, "timetable": timetable})}
|
||||
context = {"stops": json.dumps(stops), "routes": json.dumps(routes), "timetable": json.dumps(timetable)}
|
||||
return render(request,"map.html", context)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user