This commit is contained in:
parent
2feeaa10ec
commit
bc3a402f1b
|
@ -25,8 +25,8 @@ RANGE_NAME = CONFIG["Google"]["RANGE_NAME"]
|
||||||
CACHE_TIMEOUT = int(CONFIG["Cache"]["TIMEOUT"])
|
CACHE_TIMEOUT = int(CONFIG["Cache"]["TIMEOUT"])
|
||||||
|
|
||||||
@app.route('/data.json')
|
@app.route('/data.json')
|
||||||
@cache.cached(timeout=CACHE_TIMEOUT)
|
|
||||||
@cross_origin()
|
@cross_origin()
|
||||||
|
@cache.cached(timeout=CACHE_TIMEOUT)
|
||||||
def data_json():
|
def data_json():
|
||||||
return google_sheet_to_json(SPREADSHEET_ID, RANGE_NAME)
|
return google_sheet_to_json(SPREADSHEET_ID, RANGE_NAME)
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ def google_sheet_to_json(spreadsheet_id, range_name):
|
||||||
return json.dumps(ret)
|
return json.dumps(ret)
|
||||||
|
|
||||||
def create_point(row):
|
def create_point(row):
|
||||||
|
if (len(row) != 17):
|
||||||
|
return None
|
||||||
active, lat, lon, name, address, capacity, startdate, enddate, hours_monday, hours_tuesday, hours_wednesday, hours_thursday, hours_friday, hours_saturday, hours_sunday, extra, location_type = row
|
active, lat, lon, name, address, capacity, startdate, enddate, hours_monday, hours_tuesday, hours_wednesday, hours_thursday, hours_friday, hours_saturday, hours_sunday, extra, location_type = row
|
||||||
if active == "FALSE":
|
if active == "FALSE":
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue