This commit is contained in:
parent
2feeaa10ec
commit
bc3a402f1b
2 changed files with 3 additions and 1 deletions
|
@ -25,8 +25,8 @@ RANGE_NAME = CONFIG["Google"]["RANGE_NAME"]
|
|||
CACHE_TIMEOUT = int(CONFIG["Cache"]["TIMEOUT"])
|
||||
|
||||
@app.route('/data.json')
|
||||
@cache.cached(timeout=CACHE_TIMEOUT)
|
||||
@cross_origin()
|
||||
@cache.cached(timeout=CACHE_TIMEOUT)
|
||||
def data_json():
|
||||
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)
|
||||
|
||||
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
|
||||
if active == "FALSE":
|
||||
return None
|
||||
|
|
Loading…
Reference in a new issue