From 4ca96e9722a692e8640acd18e605fad9702521a9 Mon Sep 17 00:00:00 2001 From: Daniel Vaz Gaspar Date: Wed, 23 Oct 2024 11:13:32 +0100 Subject: [PATCH] fix: wtforms 3.2 breaking field_flags (#2279) * test: wtforms 3.2 * fix: wtforms 3.2 breaking field_flags * fix ci * fix ci --- .github/workflows/ci.yml | 12 ++++++------ flask_appbuilder/security/forms.py | 2 +- flask_appbuilder/validators.py | 2 +- requirements/base.txt | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd2a76e680..2bed3aa803 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8] + python-version: ["3.10"] steps: - name: Checkout code uses: actions/checkout@v4 @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] env: SQLALCHEMY_DATABASE_URI: postgresql+psycopg2://pguser:pguserpassword@127.0.0.1:15432/app @@ -91,7 +91,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8] + python-version: ["3.10"] env: SQLALCHEMY_DATABASE_URI: | mysql+mysqldb://mysqluser:mysqluserpassword@127.0.0.1:13306/app?charset=utf8mb4&binary_prefix=true @@ -142,7 +142,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8] + python-version: ["3.10"] env: SQLALCHEMY_DATABASE_URI: | mssql+pyodbc://sa:Password_123@localhost:11433/master?driver=FreeTDS @@ -192,7 +192,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8] + python-version: ["3.10"] services: mongo: image: mongo:4.4.1-bionic @@ -224,7 +224,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8] + python-version: ["3.10"] steps: - uses: actions/checkout@v4 - name: Setup Python diff --git a/flask_appbuilder/security/forms.py b/flask_appbuilder/security/forms.py index 2f1a8d3ebe..bb16c258ba 100644 --- a/flask_appbuilder/security/forms.py +++ b/flask_appbuilder/security/forms.py @@ -18,7 +18,7 @@ class SelectDataRequired(DataRequired): select fields """ - field_flags = () + field_flags = {} class LoginForm_oid(DynamicForm): diff --git a/flask_appbuilder/validators.py b/flask_appbuilder/validators.py index 6453611917..2c49fed625 100644 --- a/flask_appbuilder/validators.py +++ b/flask_appbuilder/validators.py @@ -26,7 +26,7 @@ class Unique: a specified table field. """ - field_flags = ("unique",) + field_flags = {"unique": True} def __init__( self, datamodel: BaseInterface, col_name: str, message: Optional[str] = None diff --git a/requirements/base.txt b/requirements/base.txt index 3821e562cd..701a9f9d8b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -135,7 +135,7 @@ werkzeug==3.0.3 # flask-login wrapt==1.15.0 # via deprecated -wtforms==3.1.0 +wtforms==3.2.1 # via # flask-appbuilder # flask-wtf