forked from M-Labs/web2019
replace deprecated json.htmlsafe_dumps
This commit is contained in:
parent
49ef25b5c3
commit
11d2e7c3d0
@ -10,6 +10,7 @@ from flask import request
|
|||||||
from flask_mail import Mail
|
from flask_mail import Mail
|
||||||
from flask_mail import Message
|
from flask_mail import Message
|
||||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
from jinja2.utils import htmlsafe_json_dumps
|
||||||
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
@ -41,7 +42,7 @@ def after(response):
|
|||||||
@app.route("/rfq", methods=["POST"])
|
@app.route("/rfq", methods=["POST"])
|
||||||
def send_rfq():
|
def send_rfq():
|
||||||
payload = request.json
|
payload = request.json
|
||||||
payload = json.loads(json.htmlsafe_dumps(payload))
|
payload = json.loads(htmlsafe_json_dumps(payload))
|
||||||
|
|
||||||
if payload is None:
|
if payload is None:
|
||||||
resp = jsonify(error="invalid data")
|
resp = jsonify(error="invalid data")
|
||||||
|
Loading…
Reference in New Issue
Block a user