From df9a540a2bd1b8e79283662b4d9f2313267fca19 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:28:22 +0100 Subject: [PATCH] ci: pre-commit autoupdate (#33) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Fabian Braun --- .pre-commit-config.yaml | 8 ++++---- djangocms_text/__init__.py | 1 + djangocms_text/apps.py | 12 ++++++------ djangocms_text/models.py | 1 - tests/test_app/admin.py | 4 +--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 686d700a..5689d6bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,19 +9,19 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v3.19.0 hooks: - id: pyupgrade args: ["--py39-plus"] - repo: https://github.com/adamchainz/django-upgrade - rev: '1.6.1' + rev: '1.22.2' hooks: - id: django-upgrade - args: [--target-version, "3.2"] + args: [--target-version, "4.2"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.15 + rev: v0.8.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/djangocms_text/__init__.py b/djangocms_text/__init__.py index 080b5662..f21cc421 100644 --- a/djangocms_text/__init__.py +++ b/djangocms_text/__init__.py @@ -15,4 +15,5 @@ 9. Publish the release when ready 10. Github actions will publish the new package to pypi """ + __version__ = "0.3.3" diff --git a/djangocms_text/apps.py b/djangocms_text/apps.py index 79fd1e2d..10a4a6cd 100644 --- a/djangocms_text/apps.py +++ b/djangocms_text/apps.py @@ -33,9 +33,9 @@ def discover_inline_editable_models(): if form: field_instance = form.base_fields.get(field_name, None) if field_instance.__class__.__name__ in registered_inline_fields: - inline_models[ - f"{model._meta.app_label}-{model._meta.model_name}-{field_name}" - ] = field_instance.__class__.__name__ + inline_models[f"{model._meta.app_label}-{model._meta.model_name}-{field_name}"] = ( + field_instance.__class__.__name__ + ) from cms.plugin_pool import plugin_pool @@ -47,9 +47,9 @@ def discover_inline_editable_models(): form = plugin.form field_instance = form.base_fields.get(field_name, None) if field_instance.__class__.__name__ in registered_inline_fields: - inline_models[ - f"{model._meta.app_label}-{model._meta.model_name}-{field_name}" - ] = field_instance.__class__.__name__ + inline_models[f"{model._meta.app_label}-{model._meta.model_name}-{field_name}"] = ( + field_instance.__class__.__name__ + ) return inline_models diff --git a/djangocms_text/models.py b/djangocms_text/models.py index 9530a927..8ea9d8de 100644 --- a/djangocms_text/models.py +++ b/djangocms_text/models.py @@ -22,7 +22,6 @@ def hyphenate(t): class AbstractText(CMSPlugin): - """ Abstract Text Plugin Class designed to be backwards compatible with djangocms-text-ckeditor: diff --git a/tests/test_app/admin.py b/tests/test_app/admin.py index f2120ecb..6ac5abe7 100644 --- a/tests/test_app/admin.py +++ b/tests/test_app/admin.py @@ -8,6 +8,7 @@ class ToppingInlineAdmin(admin.TabularInline): extra = 1 +@admin.register(Pizza) class PizzaAdmin(admin.ModelAdmin): fieldsets = ( ( @@ -27,6 +28,3 @@ class PizzaAdmin(admin.ModelAdmin): ), ) inlines = [ToppingInlineAdmin] - - -admin.site.register(Pizza, PizzaAdmin)