Python 3.11

This commit is contained in:
f4lco
2022-11-01 22:26:41 +01:00
parent 3dabf375c9
commit c308118e8f
12 changed files with 413 additions and 486 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ def download_menu(menu_params):
'data': False
}
request = requests.post(URL, params=params, json=body)
request = requests.post(URL, params=params, json=body, timeout=30)
# urllib3 does not log response bodies - requests no longer supports it:
# https://2.python-requests.org//en/master/api/#api-changes
+3 -4
View File
@@ -30,14 +30,13 @@ if 'BASE_URL' in os.environ: # pragma: no cover
if base_url.path:
app.config['APPLICATION_ROOT'] = base_url.path
cache = ct.ttl.TTLCache(maxsize=30, ttl=CACHE_TIMEOUT)
cache = ct.TTLCache(maxsize=30, ttl=CACHE_TIMEOUT)
def canteen_not_found(config, canteen_name):
log.warning('Canteen %s not found', canteen_name)
configured = ', '.join("'{}'".format(c) for c in config.keys())
message = "Canteen '{0}' not found, available: {1}".format(canteen_name,
configured)
configured = ', '.join(f"'{c}'" for c in config.keys())
message = f"Canteen '{canteen_name}' not found, available: {configured}"
return make_response(message, 404)