Commit 8cc780c1 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Type/Message: check mapping is a dict at creation time

If mapping is not a dict, we store a message that would fail later when
being viewed, typically breaking History tab when used in workflow
history.
parent 0f0c5b62
...@@ -96,6 +96,8 @@ class Message(Persistent): ...@@ -96,6 +96,8 @@ class Message(Persistent):
def __init__(self, domain=None, message='', def __init__(self, domain=None, message='',
mapping=None, default=None): mapping=None, default=None):
self.message = message self.message = message
if mapping is not None:
assert isinstance(mapping, dict)
self.mapping = mapping self.mapping = mapping
self.domain = domain self.domain = domain
if default is None: if default is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment