lol
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from urllib.parse import urlencode
|
||||
|
||||
from flask import current_app
|
||||
from flask import Markup
|
||||
from werkzeug.urls import url_encode
|
||||
from markupsafe import Markup
|
||||
|
||||
RECAPTCHA_SCRIPT_DEFAULT = "https://www.google.com/recaptcha/api.js"
|
||||
RECAPTCHA_DIV_CLASS_DEFAULT = "g-recaptcha"
|
||||
@@ -22,10 +23,10 @@ class RecaptchaWidget:
|
||||
if not script:
|
||||
script = RECAPTCHA_SCRIPT_DEFAULT
|
||||
if params:
|
||||
script += "?" + url_encode(params)
|
||||
script += "?" + urlencode(params)
|
||||
attrs = current_app.config.get("RECAPTCHA_DATA_ATTRS", {})
|
||||
attrs["sitekey"] = public_key
|
||||
snippet = " ".join(f'data-{k}="{attrs[k]}"' for k in attrs) # noqa: B028
|
||||
snippet = " ".join(f'data-{k}="{attrs[k]}"' for k in attrs) # noqa: B028, B907
|
||||
div_class = current_app.config.get("RECAPTCHA_DIV_CLASS")
|
||||
if not div_class:
|
||||
div_class = RECAPTCHA_DIV_CLASS_DEFAULT
|
||||
|
||||
Reference in New Issue
Block a user