django-cms / djangocms-bootstrap4

django CMS Bootstrap 4 is a plugin bundle for django CMS providing several components from the popular Bootstrap 4 framework.
https://www.django-cms.org/
Other
82 stars 58 forks source link

[BUG] Container opens with an exception #163

Open florianRepenn opened 3 weeks ago

florianRepenn commented 3 weeks ago

Description

Django: 4.2 django-cms: 3.11.6 djangocms-bootstrap4: 3.0.1

Adding the content element Container leads to the following exception:

TypeError at /de/admin/cms/page/add-plugin/
__str__ returned non-string (type __proxy__)

The reason for this is gettext_lazy returning a __proxy__ object instead of the actual string of the help_text fields.

Solution

Replacing gettext_lazy with gettext in djangocms_bootstrap4/contrib/bootstrap4_grid/models.py solves the problem.

This could have the side effect of not getting the correct translations of the help_text fields when creating a Container. But when I tested it on older versions (Django 3.1, django-cms 3.7.4, djangocms-bootstrap4 1.6.0) where the plugin still works, there were no translations either.

Screenshot

exception1

florianRepenn commented 3 weeks ago

PR: https://github.com/django-cms/djangocms-bootstrap4/pull/164