@@ -86,12 +86,19 @@ def check_ckeditor_settings(app_configs, **kwargs) -> list: # pragma: no cover
86
86
obj = "settings.TEXT_ADDITIONAL_ATTRIBUTES" ,
87
87
)
88
88
)
89
- warnings += check_ckeditor_settings_dict (settings )
89
+ if check_ckeditor_cms_plugin_settings (settings ):
90
+ warnings .append (
91
+ Warning (
92
+ "The CKEDITOR_SETTINGS toolbar setting has changed: Instead of 'cmsplugins' use 'CMSPlugins'." ,
93
+ hint = "Replace 'cmspluings' by 'CMSPlugins' in CKEDITOR_SETTINGS." ,
94
+ id = "text.W003" ,
95
+ )
96
+ )
90
97
91
98
return warnings
92
99
93
100
94
- def check_ckeditor_settings_dict (settings : object ) -> list : # pragma: no cover
101
+ def check_ckeditor_cms_plugin_settings (settings : object ) -> list : # pragma: no cover
95
102
def recursive_replace (config_list : list , old : str , new : str ):
96
103
"""Replace target string in toolbar lists and return True if any change occurred."""
97
104
changed = False
@@ -111,17 +118,11 @@ def recursive_replace(config_list: list, old: str, new: str):
111
118
112
119
for key , value in ckeditor_settings .items ():
113
120
if "toolbar" in key and isinstance (value , list ):
114
- change_required = recursive_replace (ckeditor_settings [key ], "cmsplugins" , "CMSPlugins" )
115
-
116
- if change_required :
117
- return [
118
- Warning (
119
- "The CKEDITOR_SETTINGS toolbar setting has changed: Instead of 'cmsplugins' use 'CMSPlugins'." ,
120
- hint = "Replace 'cmspluings' by 'CMSPlugins' in CKEDITOR_SETTINGS." ,
121
- id = "text.W003" ,
121
+ change_required = change_required or recursive_replace (
122
+ ckeditor_settings [key ], "cmsplugins" , "CMSPlugins"
122
123
)
123
- ]
124
- return []
124
+ return change_required
125
+ return False
125
126
126
127
127
128
def check_no_cms_config (app_configs , ** kwargs ) -> list : # pragma: no cover
0 commit comments