From 822edbf30c37cfbc7440f5abb6c1f0e6e520aa30 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 22 Feb 2022 15:46:48 +0100 Subject: [PATCH] Fix: ensure force_text on plugins' __str__() --- djangocms_frontend/cms_plugins.py | 4 ++++ docs/getting_started.rst | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/djangocms_frontend/cms_plugins.py b/djangocms_frontend/cms_plugins.py index 9c5ef3d7..9380857b 100644 --- a/djangocms_frontend/cms_plugins.py +++ b/djangocms_frontend/cms_plugins.py @@ -1,6 +1,10 @@ from cms.plugin_base import CMSPluginBase +from django.utils.encoding import force_text class CMSUIPlugin(CMSPluginBase): render_template = "djangocms_frontend/html_container.html" change_form_template = "djangocms_frontend/admin/base.html" + + def __str__(self): + return force_text(super().__str__()) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 4b68c0c4..42620744 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -199,6 +199,30 @@ course - view instances of all djangocms_frontend UI items: Otherwise the plugins will not be editable and will not appear in the editors' plugin selection when adding a plugin in the frontend. +Since changing them for each of the plugins manually can become tiresome a +management command can support you. + +**First** manually define the permissions for the model ``FrontendUIItem`` of +the app ``djangocms_frontend``. **Then** you can synchronize +all permissions of the installed UI items by typing + +.. code-block:: + + ./manage.py frontend sync_permissions users + ./manage.py frontend sync_permissions groups + +These commands transfer the permissions for ``FrontendUIItem`` to all installed +plugins for each user or group, respectively. + +The first command is only necessary of you define by-user permissions. Depending +on the number of users it may take some time. + + + +.. attention:: + + If in doubt, please make a backup of your database tables. This operation + cannot be undone! .. index:: single: Migration from Bootstrap 4