Skip to content

Commit

Permalink
More ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed May 22, 2024
1 parent 70e50f1 commit 470152d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -128,7 +128,7 @@ exclude = [
"venv",
]

ignore = [
lint.ignore = [
"E501", # line-too-long
"W191", # tab-indentation
]
Expand Down
5 changes: 2 additions & 3 deletions src/djangocms_snippet/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -184,12 +184,11 @@ def preview_view(
)

def get_urls(self):
info = self.model._meta.app_label, self.model._meta.model_name
return [
path(
"<int:snippet_id>/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(),
]
Expand Down

0 comments on commit 470152d

Please sign in to comment.