Allow adding spots. Convert timestamps in the API to UNIX seconds. #2

This commit is contained in:
Ian Renton
2025-10-04 13:28:22 +01:00
parent 0419aab83f
commit 5f16abf709
16 changed files with 51 additions and 37 deletions

View File

@@ -87,10 +87,11 @@ class WebServer:
response.content_type = 'application/json'
response.set_header('Cache-Control', 'no-store')
return json.dumps("OK", default=serialize_everything)
except Exception:
response.content_type = 'application/json'
response.status = 422
return json.dumps("An error occurred parsing your spot. Check it is compliant with the API.", default=serialize_everything)
except Exception as e:
logging.error(e)
response.content_type = 'application/json'
response.status = 422
return json.dumps("An error occurred parsing your spot: " + str(e), default=serialize_everything)
# Serve a templated page
def serve_template(self, template_name):