forked from pool/python-Flask-WTF
Accepting request 1129045 from home:alarrosa:branches:devel:languages:python:flask
- Update to 1.2.1: * Fix a bug introduced with #556 in 1.2.0 where file validators were editing the file fields content. - Update to 1.2.0: * Add field MultipleFileField. FileRequired, FileAllowed, FileSize now can be used to validate multiple files - Update to 1.1.2: * Fixed Flask 2.3 deprecations of werkzeug.urls.url_encode and flask.Markup * Stop support for python 3.7 * Use pyproject.toml instead of setup.cfg * Fixed nested blueprint CSRF exemption - Drop patch already included upstream: * flask-2.3-support.patch OBS-URL: https://build.opensuse.org/request/show/1129045 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:flask/python-Flask-WTF?expand=0&rev=16
This commit is contained in:
parent
b611c04334
commit
ebf3c5a766
@ -1,87 +0,0 @@
|
|||||||
From 603318bfb31958572ff250fa29fc4e4678d438c8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Matt Shaw <matthew-shaw@users.noreply.github.com>
|
|
||||||
Date: Tue, 25 Apr 2023 22:07:52 +0100
|
|
||||||
Subject: [PATCH 1/2] fix #561
|
|
||||||
|
|
||||||
---
|
|
||||||
src/flask_wtf/recaptcha/widgets.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
Index: Flask-WTF-1.1.1/src/flask_wtf/recaptcha/widgets.py
|
|
||||||
===================================================================
|
|
||||||
--- Flask-WTF-1.1.1.orig/src/flask_wtf/recaptcha/widgets.py
|
|
||||||
+++ Flask-WTF-1.1.1/src/flask_wtf/recaptcha/widgets.py
|
|
||||||
@@ -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,7 +23,7 @@ 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
|
|
||||||
Index: Flask-WTF-1.1.1/docs/changes.rst
|
|
||||||
===================================================================
|
|
||||||
--- Flask-WTF-1.1.1.orig/docs/changes.rst
|
|
||||||
+++ Flask-WTF-1.1.1/docs/changes.rst
|
|
||||||
@@ -1,6 +1,14 @@
|
|
||||||
Changes
|
|
||||||
=======
|
|
||||||
|
|
||||||
+Version 1.1.2
|
|
||||||
+-------------
|
|
||||||
+
|
|
||||||
+Unreleased
|
|
||||||
+
|
|
||||||
+- Fixed Flask 2.3 deprecations of ``werkzeug.urls.url_encode`` and
|
|
||||||
+ ``flask.Markup`` `:pr:`565` :issue:`561`
|
|
||||||
+
|
|
||||||
Version 1.1.1
|
|
||||||
-------------
|
|
||||||
|
|
||||||
Index: Flask-WTF-1.1.1/src/flask_wtf/recaptcha/validators.py
|
|
||||||
===================================================================
|
|
||||||
--- Flask-WTF-1.1.1.orig/src/flask_wtf/recaptcha/validators.py
|
|
||||||
+++ Flask-WTF-1.1.1/src/flask_wtf/recaptcha/validators.py
|
|
||||||
@@ -1,9 +1,9 @@
|
|
||||||
import json
|
|
||||||
from urllib import request as http
|
|
||||||
+from urllib.parse import urlencode
|
|
||||||
|
|
||||||
from flask import current_app
|
|
||||||
from flask import request
|
|
||||||
-from werkzeug.urls import url_encode
|
|
||||||
from wtforms import ValidationError
|
|
||||||
|
|
||||||
RECAPTCHA_VERIFY_SERVER_DEFAULT = "https://www.google.com/recaptcha/api/siteverify"
|
|
||||||
@@ -54,7 +54,7 @@ class Recaptcha:
|
|
||||||
if not verify_server:
|
|
||||||
verify_server = RECAPTCHA_VERIFY_SERVER_DEFAULT
|
|
||||||
|
|
||||||
- data = url_encode(
|
|
||||||
+ data = urlencode(
|
|
||||||
{"secret": private_key, "remoteip": remote_addr, "response": response}
|
|
||||||
)
|
|
||||||
|
|
||||||
Index: Flask-WTF-1.1.1/tests/test_recaptcha.py
|
|
||||||
===================================================================
|
|
||||||
--- Flask-WTF-1.1.1.orig/tests/test_recaptcha.py
|
|
||||||
+++ Flask-WTF-1.1.1/tests/test_recaptcha.py
|
|
||||||
@@ -80,7 +80,6 @@ def test_render_custom_args(app):
|
|
||||||
app.config["RECAPTCHA_DATA_ATTRS"] = {"red": "blue"}
|
|
||||||
f = RecaptchaForm()
|
|
||||||
render = f.recaptcha()
|
|
||||||
- # new versions of url_encode allow more characters
|
|
||||||
assert "?key=(value)" in render or "?key=%28value%29" in render
|
|
||||||
assert 'data-red="blue"' in render
|
|
||||||
|
|
3
flask_wtf-1.2.1.tar.gz
Normal file
3
flask_wtf-1.2.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:8bb269eb9bb46b87e7c8233d7e7debdf1f8b74bf90cc1789988c29b37a97b695
|
||||||
|
size 42498
|
@ -1,3 +1,21 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 27 08:10:47 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>
|
||||||
|
|
||||||
|
- Update to 1.2.1:
|
||||||
|
* Fix a bug introduced with #556 in 1.2.0 where file validators
|
||||||
|
were editing the file fields content.
|
||||||
|
- Update to 1.2.0:
|
||||||
|
* Add field MultipleFileField. FileRequired, FileAllowed,
|
||||||
|
FileSize now can be used to validate multiple files
|
||||||
|
- Update to 1.1.2:
|
||||||
|
* Fixed Flask 2.3 deprecations of werkzeug.urls.url_encode and
|
||||||
|
flask.Markup
|
||||||
|
* Stop support for python 3.7
|
||||||
|
* Use pyproject.toml instead of setup.cfg
|
||||||
|
* Fixed nested blueprint CSRF exemption
|
||||||
|
- Drop patch already included upstream:
|
||||||
|
* flask-2.3-support.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Jun 30 05:16:29 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
Fri Jun 30 05:16:29 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
@ -18,15 +18,14 @@
|
|||||||
|
|
||||||
%bcond_without test
|
%bcond_without test
|
||||||
Name: python-Flask-WTF
|
Name: python-Flask-WTF
|
||||||
Version: 1.1.1
|
Version: 1.2.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: WTForms support for Flask
|
Summary: WTForms support for Flask
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: https://github.com/lepture/flask-wtf
|
URL: https://github.com/lepture/flask-wtf
|
||||||
Source: https://files.pythonhosted.org/packages/source/F/Flask-WTF/Flask-WTF-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/F/Flask-WTF/flask_wtf-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM gh#wtforms/flask-wtf#565
|
BuildRequires: %{python_module base >= 3.8}
|
||||||
Patch0: flask-2.3-support.patch
|
BuildRequires: %{python_module hatchling}
|
||||||
BuildRequires: %{python_module base >= 3.7}
|
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
@ -52,7 +51,7 @@ BuildRequires: %{python_module pytest}
|
|||||||
Adds WTForms support to your Flask application
|
Adds WTForms support to your Flask application
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n Flask-WTF-%{version}
|
%autosetup -p1 -n flask_wtf-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
@ -72,6 +71,6 @@ export LANG=en_US.UTF-8
|
|||||||
%license LICENSE.rst
|
%license LICENSE.rst
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python_sitelib}/flask_wtf
|
%{python_sitelib}/flask_wtf
|
||||||
%{python_sitelib}/Flask_WTF-%{version}.dist-info
|
%{python_sitelib}/flask_wtf-%{version}.dist-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user