lat / lon are strings now for some reason so cast to float first

This commit is contained in:
Michaela Wheeler 2022-01-07 16:12:59 +11:00
parent a4bbb83b62
commit 3c20be8697

View File

@ -135,7 +135,7 @@ def put(event, context):
if not sondeExists(recovered["serial"]): if not sondeExists(recovered["serial"]):
return {"statusCode": 400, "body": json.dumps({"message": "serial not found in db"})} return {"statusCode": 400, "body": json.dumps({"message": "serial not found in db"})}
recovered['position'] = [recovered['lon'], recovered['lat']] recovered['position'] = [float(recovered['lon']), float(recovered['lat'])]
result = es.request(json.dumps(recovered), "recovered/_doc", "POST") result = es.request(json.dumps(recovered), "recovered/_doc", "POST")