mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Allow adding spots. Convert timestamps in the API to UNIX seconds. #2
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user