feat(issue22/server-flask): Checks payload is None

This commit is contained in:
sovanna 2020-04-14 14:23:01 +09:00
parent e2bb66f5f1
commit 64730e8557

View File

@ -13,6 +13,10 @@ def send_rfq():
payload = request.json
payload = json.loads(json.htmlsafe_dumps(payload))
if payload is None:
resp = jsonify(error="invalid data")
return make_response(resp, 400)
if "email" not in payload:
resp = jsonify(error="missing email")
return make_response(resp, 400)