Skip to content

Commit

Permalink
ci: pre-commit autoupdate (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 3, 2025
1 parent 89fc27c commit 13e4f0a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
args: [--target-version, "4.2"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion djangocms_text/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def check_ckeditor_settings(app_configs, **kwargs): # pragma: no cover
f"The TEXT_ADDITIONAL_TAGS setting is deprecated and will be removed in a future release.\n"
f"{change_msg}",
f"TEXT_ADDITIONAL_ATTRIBUTES = "
f"""{{{', '.join([f'"{tag}": set()' for tag in settings.TEXT_ADDITIONAL_TAGS])}\"}}\n""",
f"""{{{", ".join([f'"{tag}": set()' for tag in settings.TEXT_ADDITIONAL_TAGS])}\"}}\n""",
id="text.W001",
obj="settings.TEXT_ADDITIONAL_TAGS",
)
Expand Down
2 changes: 1 addition & 1 deletion djangocms_text/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def plugin_to_tag(obj: CMSPlugin, content: str = "", admin: bool = False):
plugin_attrs["preview"] = "true" if preview else "false"
plugin_attrs["type"] = plugin_class.__name__
else:
plugin_tag = '<cms-plugin alt="%(icon_alt)s" ' 'title="%(icon_alt)s" id="%(id)d">%(content)s</cms-plugin>'
plugin_tag = '<cms-plugin alt="%(icon_alt)s" title="%(icon_alt)s" id="%(id)d">%(content)s</cms-plugin>'
return plugin_tag % plugin_attrs


Expand Down
2 changes: 1 addition & 1 deletion djangocms_text/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __init__(

self.editor_class = "CMS_Editor"
if self.editor_class not in attrs.get("class", "").join(" "):
new_class = f'{attrs.get("class", "")} {self.editor_class}'
new_class = f"{attrs.get('class', '')} {self.editor_class}"
attrs["class"] = new_class.strip()
self.editor_settings_id = f"cms-cfg-{pk if pk else attrs.get('id', uuid.uuid4())}"
self.global_settings_id = "cms-editor-cfg"
Expand Down
8 changes: 4 additions & 4 deletions tests/test_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def test_html_form_field(self):

class FieldTestCase(BaseTestCase):
text_normal = "<p>some non malicious text</p>"
text_with_iframe = "<p>some non malicious text</p>" '<iframe src="http://www.w3schools.com"></iframe>'
text_with_iframe = '<p>some non malicious text</p><iframe src="http://www.w3schools.com"></iframe>'
text_with_iframe_escaped = (
"<p>some non malicious text</p>&lt;iframe " 'src="http://www.w3schools.com"&gt;&lt;/iframe&gt;'
'<p>some non malicious text</p>&lt;iframe src="http://www.w3schools.com"&gt;&lt;/iframe&gt;'
)
text_with_script = "<p>some non malicious text</p>" '<script>alert("Hello! I am an alert box!");</script>'
text_with_script = '<p>some non malicious text</p><script>alert("Hello! I am an alert box!");</script>'
text_with_script_escaped = (
"<p>some non malicious text</p>&lt;script&gt;" 'alert("Hello! I am an alert box!");&lt;/script&gt;'
'<p>some non malicious text</p>&lt;script&gt;alert("Hello! I am an alert box!");&lt;/script&gt;'
)

def test_model_field_text_is_safe(self):
Expand Down

0 comments on commit 13e4f0a

Please sign in to comment.