This commit is contained in:
Robbe Van Herck 2020-05-13 18:40:26 +02:00
parent 2feeaa10ec
commit bc3a402f1b
2 changed files with 3 additions and 1 deletions

View file

@ -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)

View file

@ -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