Skip to content

Commit

Permalink
Silence the CKEditor version check/nag but include a system check war…
Browse files Browse the repository at this point in the history
…ning of our own

Fixes #761.
  • Loading branch information
matthiask committed Feb 8, 2024
1 parent 974c858 commit d1cd092
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions ckeditor/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.apps import AppConfig
from django.core.checks import Warning, register


def check_ckeditor_version(app_configs, **kwargs):
return [
Warning(
"django-ckeditor bundles CKEditor 4.22.1 which isn't supported anmyore and which does have unfixed security issues, see for example https://ckeditor.com/cke4/release/CKEditor-4.24.0-LTS . You should consider strongly switching to a different editor (maybe CKEditor 5 respectively django-ckeditor-5 after checking whether the CKEditor 5 license terms work for you) or switch to the non-free CKEditor 4 LTS package. See https://ckeditor.com/ckeditor-4-support/ for more on this. (Note! This notice has been added by the django-ckeditor developers and we are not affiliated with CKSource and were not included in the licensing change, so please refrain from complaining to us. Thanks.)",
id="ckeditor.W001",
)
]


class CKEditorConfig(AppConfig):
default_auto_field = "django.db.models.AutoField"
name = "ckeditor"

def ready(self):
register(check_ckeditor_version)
3 changes: 2 additions & 1 deletion ckeditor/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def media(self):
},
),
"ckeditor/ckeditor/ckeditor.js",
)
),
)

def get_context(self, name, value, attrs):
Expand All @@ -126,3 +126,4 @@ def _set_config(self):
elif lang == "zh-hant":
lang = "zh"
self.config["language"] = lang
self.config["versionCheck"] = False

0 comments on commit d1cd092

Please sign in to comment.