forked from M-Labs/web2019
feat(issue22/server-flask): Checks payload is None
This commit is contained in:
parent
e2bb66f5f1
commit
64730e8557
|
@ -13,6 +13,10 @@ def send_rfq():
|
||||||
payload = request.json
|
payload = request.json
|
||||||
payload = json.loads(json.htmlsafe_dumps(payload))
|
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:
|
if "email" not in payload:
|
||||||
resp = jsonify(error="missing email")
|
resp = jsonify(error="missing email")
|
||||||
return make_response(resp, 400)
|
return make_response(resp, 400)
|
||||||
|
|
Loading…
Reference in New Issue