From f104e9f091a148a3626d3ca25b42ae9983a65862 Mon Sep 17 00:00:00 2001 From: "Norbert @ infoCatch" Date: Wed, 29 Mar 2017 14:01:46 +0200 Subject: [PATCH] Ensure error message is an unicode object and not utf-8 bytestring --- CHANGES.rst | 3 ++- plone/app/contentrules/actions/workflow.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index c99a809..154b0a6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,7 +14,8 @@ New features: Bug fixes: -- *add item here* +- Ensure error message is an unicode object + [mtrebron] 4.0.14 (2017-04-02) diff --git a/plone/app/contentrules/actions/workflow.py b/plone/app/contentrules/actions/workflow.py index 440ecc9..39d3c60 100644 --- a/plone/app/contentrules/actions/workflow.py +++ b/plone/app/contentrules/actions/workflow.py @@ -71,7 +71,8 @@ def __call__(self): def error(self, obj, error): request = getattr(self.context, 'REQUEST', None) if request is not None: - title = utils.pretty_title_or_id(obj, obj) + title = utils.safe_unicode(utils.pretty_title_or_id(obj, obj)) + error = utils.safe_unicode(error) message = _( u"Unable to change state of ${name} as part of content rule 'workflow' action: ${error}", # noqa mapping={'name': title, 'error': error})