Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Oct 25, 2024
1 parent efc6fd1 commit fcfbcdf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions djangocms_link/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from django.contrib.admin import site
from django.contrib.admin.widgets import SELECT2_TRANSLATIONS, AutocompleteSelect
from django.contrib.sites.models import Site
from django.db.models import JSONField, ManyToOneRel, ForeignKey, SET_NULL
from django.forms import Field, MultiWidget, Select, TextInput, URLInput, CheckboxInput
from django.db.models import JSONField, ManyToOneRel
from django.forms import Field, MultiWidget, Select, TextInput, URLInput
from django.utils.translation import get_language
from django.utils.translation import gettext_lazy as _

Expand Down Expand Up @@ -151,6 +151,7 @@ class LinkWidget(MultiWidget):
template_name = "djangocms_link/admin/link_widget.html"
data_pos = {}
number_sites = None

class Media:
js = ("djangocms_link/link-widget.js",)
css = {"all": ("djangocms_link/link-widget.css",)}
Expand All @@ -172,7 +173,7 @@ def __init__(self):
attrs={
"class": "js-link-site-widget",
"widget": "site",
"data-placeholder": "XXX", #_("Select site"),
"data-placeholder": _("Select site"),
},
), # Site selector
LinkAutoCompleteWidget(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_file(self):
self.assertIn("/media/filer_public/", plugin.get_link())

def test_rendering(self):
plugin = add_plugin(
add_plugin(
self.get_placeholders(self.page, self.language).get(slot="content"),
"LinkPlugin",
"en",
Expand All @@ -191,12 +191,12 @@ def test_rendering(self):
self.assertContains(response, '<a href="/en/content/">Link</a>')

def test_rendering_fallback(self):
plugin = add_plugin(
add_plugin(
self.get_placeholders(self.page, self.language).get(slot="content"),
"LinkPlugin",
"en",
name="Link",
link={"internal_link": f"cms.page:0"},
link={"internal_link": "cms.page:0"},
)
self.publish(self.page, self.language)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def assertDoesNotValidate(self, validator, value):
try:
validator(value)
self.fail(f"Validation of {value} unexpectedly did not fail")
except Exception as e:
except Exception:
pass

def test_intranet_host_re(self):
Expand Down

0 comments on commit fcfbcdf

Please sign in to comment.