Skip to content

Commit c80cf19

Browse files
authored
fix: Crashed on startup if djangocms-text was not installed (#266)
1 parent af923bf commit c80cf19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

djangocms_frontend/component_pool.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def find_cms_component_templates() -> list[tuple[str, str]]:
3030

3131
class CMSAutoComponentDiscovery:
3232
default_field_context = {
33-
"djanghocms_text": "djangocms_text.fields.TextFormField",
34-
"djanghocms_text_ckeditor": "djangocms_text_ckeditor.fields.TextFormField",
33+
"djangocms_text": "djangocms_text.fields.HTMLFormField",
34+
"djangocms_text_ckeditor": "djangocms_text_ckeditor.fields.HTMLFormField",
3535
"djangocms_link": "djangocms_link.fields.LinkFormField",
3636
"djangocms_frontend": [
3737
"djangocms_frontend.contrib.image.fields.ImageFormField",
@@ -141,9 +141,10 @@ def setup():
141141
update_plugin_pool()
142142
components._discovered = True
143143

144-
if text_config := apps.get_app_config("djangocms_text"):
144+
if apps.is_installed("djangocms_text"):
145145
# Hack - update inline editable fields in case djangocms_text is installed
146146
# BEFORE djangocms_frontend in INSTALLED_APPS
147+
text_config = apps.get_app_config("djangocms_text")
147148
if text_config.inline_models:
148149
# Already initialized? Need to initialize again
149150
# to reflect inline fields in of just discovered components

0 commit comments

Comments
 (0)