From 470152d4ef10e4ddfd22d5224914c533dc1fa525 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Wed, 22 May 2024 13:18:13 +0200 Subject: [PATCH] More ruff fixes --- pyproject.toml | 6 +++--- src/djangocms_snippet/admin.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5696e183..f964b7c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,8 +93,8 @@ allow_untyped_defs = true [tool.ruff] # https://beta.ruff.rs/docs/configuration/ -line-length = 79 -select = [ +line-length = 120 +lint.select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes @@ -128,7 +128,7 @@ exclude = [ "venv", ] -ignore = [ +lint.ignore = [ "E501", # line-too-long "W191", # tab-indentation ] diff --git a/src/djangocms_snippet/admin.py b/src/djangocms_snippet/admin.py index a4de0d46..93df48ad 100644 --- a/src/djangocms_snippet/admin.py +++ b/src/djangocms_snippet/admin.py @@ -115,7 +115,7 @@ def preview_view( if to_field and not self.to_field_allowed(request, to_field): raise DisallowedModelAdminToField( - "The field %s cannot be referenced." % to_field + f"The field {to_field} cannot be referenced." ) model = self.model @@ -184,12 +184,11 @@ def preview_view( ) def get_urls(self): - info = self.model._meta.app_label, self.model._meta.model_name return [ path( "/preview/", self.admin_site.admin_view(self.preview_view), - name="{}_{}_preview".format(*info), + name=f"{self.model._meta.app_label}_{self.model._meta.model_name}_preview" ), *super().get_urls(), ]