For validation

This commit is contained in:
Arc 2020-01-29 12:34:42 +00:00 committed by GitHub
parent fc9b30bbee
commit 60739a7587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,10 @@ def api_invoices():
return jsonify({"ERROR": "MUST BE JSON"}), 400
postedjson = request.json
#Form validation
if int(postedjson["value"]) < 0 or not postedjson["memo"].replace(' ','').isalnum():
return jsonify({"ERROR": "FORM ERROR"}), 401
if "value" not in postedjson:
return jsonify({"ERROR": "NO VALUE"}), 400