-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMSPluginBase should use force_text and force_str for __str__ and __repr__ #5034
Comments
Or maybe So instead of def get_plugin_name(self):
from cms.plugin_pool import plugin_pool
return plugin_pool.get_plugin(self.plugin_type).name it should be something like def get_plugin_name(self):
from cms.plugin_pool import plugin_pool
return smart_text(plugin_pool.get_plugin(self.plugin_type)) Assuming that it's ok to have |
@yakky @mkoistinen Do you guys see a problem in using Something we can squeeze in 3.2.2? or wait for 3.3? |
I think both the @divio/django-cms-core thoughts? |
@czpython @stefanfoulis IIRC |
Appears to have been resolved and merged in the PR referenced above. |
When working on aldryn_bootstrap3 plugin, I stumbled upon a following error:
This exception also gets raised when trying to publish some changes. Looking at the code, the problem seems to be in
CMSPluginBase
: https://github.com/divio/django-cms/blob/develop/cms%2Fplugin_base.py#L347-L351Because
__str__
and__repr__
don't useforce_text
andforce_str
, the lazy translation causes an error. Therefore,CMSPluginBase
should probably useforce_text
andforce_str
for__str__
and__repr__
The text was updated successfully, but these errors were encountered: