Skip to content

Commit

Permalink
Fix codestyle, update ruff and black
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed Oct 6, 2023
1 parent 0010a69 commit 37b90e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ clean = "rm -rf docs/_build"

[tool.hatch.envs.lint]
dependencies = [
"black>=23.3.0",
"ruff>=0.0.270",
"black>=23.9.1",
"ruff>=0.0.292",
]
detached = true

Expand Down
16 changes: 2 additions & 14 deletions src/bootstrap3/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,20 +382,8 @@ def make_input_group(self, html):
if (self.addon_before or self.addon_after) and isinstance(
self.widget, (TextInput, NumberInput, EmailInput, URLInput, DateInput, Select, PasswordInput)
):
before = (
'<span class="{input_class}">{addon}</span>'.format(
input_class=self.addon_before_class, addon=self.addon_before
)
if self.addon_before
else ""
)
after = (
'<span class="{input_class}">{addon}</span>'.format(
input_class=self.addon_after_class, addon=self.addon_after
)
if self.addon_after
else ""
)
before = f'<span class="{self.addon_before_class}">{self.addon_before}</span>' if self.addon_before else ""
after = f'<span class="{self.addon_after_class}">{self.addon_after}</span>' if self.addon_after else ""
html = f'<div class="input-group">{before}{html}{after}</div>'
return html

Expand Down
4 changes: 1 addition & 3 deletions tests/test_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,7 @@ def assertFieldHasAddons(self, field):
addon_after = "af"

res = render_template_with_form(
'{{% bootstrap_field form.{} addon_before="{}" addon_after="{}" %}}'.format(
field, addon_before, addon_after
)
f'{{% bootstrap_field form.{field} addon_before="{addon_before}" addon_after="{addon_after}" %}}'
)

self.assertIn('class="input-group"', res)
Expand Down

0 comments on commit 37b90e2

Please sign in to comment.