Skip to content

Commit 822edbf

Browse files
committed
Fix: ensure force_text on plugins' __str__()
1 parent a7c2a6f commit 822edbf

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

djangocms_frontend/cms_plugins.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from cms.plugin_base import CMSPluginBase
2+
from django.utils.encoding import force_text
23

34

45
class CMSUIPlugin(CMSPluginBase):
56
render_template = "djangocms_frontend/html_container.html"
67
change_form_template = "djangocms_frontend/admin/base.html"
8+
9+
def __str__(self):
10+
return force_text(super().__str__())

docs/getting_started.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,30 @@ course - view instances of all djangocms_frontend UI items:
199199
Otherwise the plugins will not be editable and will not appear in the editors'
200200
plugin selection when adding a plugin in the frontend.
201201

202+
Since changing them for each of the plugins manually can become tiresome a
203+
management command can support you.
204+
205+
**First** manually define the permissions for the model ``FrontendUIItem`` of
206+
the app ``djangocms_frontend``. **Then** you can synchronize
207+
all permissions of the installed UI items by typing
208+
209+
.. code-block::
210+
211+
./manage.py frontend sync_permissions users
212+
./manage.py frontend sync_permissions groups
213+
214+
These commands transfer the permissions for ``FrontendUIItem`` to all installed
215+
plugins for each user or group, respectively.
216+
217+
The first command is only necessary of you define by-user permissions. Depending
218+
on the number of users it may take some time.
219+
220+
221+
222+
.. attention::
223+
224+
If in doubt, please make a backup of your database tables. This operation
225+
cannot be undone!
202226

203227
.. index::
204228
single: Migration from Bootstrap 4

0 commit comments

Comments
 (0)