mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-19 12:01:12 +02:00
For validation
This commit is contained in:
@@ -229,7 +229,10 @@ def api_invoices():
|
|||||||
return jsonify({"ERROR": "MUST BE JSON"}), 400
|
return jsonify({"ERROR": "MUST BE JSON"}), 400
|
||||||
|
|
||||||
postedjson = request.json
|
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:
|
if "value" not in postedjson:
|
||||||
return jsonify({"ERROR": "NO VALUE"}), 400
|
return jsonify({"ERROR": "NO VALUE"}), 400
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user