Skip to content

Commit

Permalink
pre-commit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Nov 26, 2024
1 parent d6198d4 commit 0dd49b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
32 changes: 16 additions & 16 deletions aldryn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions djangocms_text_ckeditor/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit 0dd49b4

Please sign in to comment.