From 0dd49b4832c3116dd266832fb1f58c8e75144811 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 26 Nov 2024 18:31:43 +0100 Subject: [PATCH] pre-commit fix --- aldryn_config.py | 32 +++++++++++++++---------------- djangocms_text_ckeditor/fields.py | 3 +-- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/aldryn_config.py b/aldryn_config.py index 77441a18..6c7040f4 100644 --- a/aldryn_config.py +++ b/aldryn_config.py @@ -7,36 +7,36 @@ class Form(forms.BaseForm): required=False, ) content_css = forms.CharField( - 'List of CSS files to be used to apply style to editor content', + "List of CSS files to be used to apply style to editor content", required=False, ) def clean(self): data = super().clean() - if data.get('content_css'): - files = data['content_css'].split(',') - data['content_css'] = [item.strip() for item in files if item] + if data.get("content_css"): + files = data["content_css"].split(",") + data["content_css"] = [item.strip() for item in files if item] return data def to_settings(self, data, settings): ckeditor_settings = { - 'height': 300, - 'language': '{{ language }}', - 'toolbar': 'CMS', - 'skin': 'moono-lisa', + "height": 300, + "language": "{{ language }}", + "toolbar": "CMS", + "skin": "moono-lisa", } - if data.get('content_css'): - ckeditor_settings['contentsCss'] = data['content_css'] + if data.get("content_css"): + ckeditor_settings["contentsCss"] = data["content_css"] else: - ckeditor_settings['contentsCss'] = ['/static/css/base.css'] + ckeditor_settings["contentsCss"] = ["/static/css/base.css"] - style_set = '' - if data.get('style_set'): - style_set = data['style_set'] + style_set = "" + if data.get("style_set"): + style_set = data["style_set"] - ckeditor_settings['stylesSet'] = f'default:{style_set}' + ckeditor_settings["stylesSet"] = f"default:{style_set}" - settings['CKEDITOR_SETTINGS'] = ckeditor_settings + settings["CKEDITOR_SETTINGS"] = ckeditor_settings return settings diff --git a/djangocms_text_ckeditor/fields.py b/djangocms_text_ckeditor/fields.py index 6f29be0b..9a543517 100644 --- a/djangocms_text_ckeditor/fields.py +++ b/djangocms_text_ckeditor/fields.py @@ -8,8 +8,7 @@ class HTMLField(TextHTMLField): # pragma: no cover def __init__(self, *args: Any, **kwargs: Any) -> None: warnings.warn( - "djangocms_text_ckeditor.fields.HTMLField is deprecated. " - "Use djangocms_text.fields.HTMLField instead.", + "djangocms_text_ckeditor.fields.HTMLField is deprecated. Use djangocms_text.fields.HTMLField instead.", DeprecationWarning, stacklevel=2, )