Commit c9a85675 authored by iv's avatar iv

ERP5Workflow: give a more explicit error when reference is not set

it was 'TypeError: cannot concatenate str and NoneType objects'
parent e2c3058d
...@@ -73,6 +73,8 @@ def IdAsReferenceMixin(extra_string, string_type="suffix"): ...@@ -73,6 +73,8 @@ def IdAsReferenceMixin(extra_string, string_type="suffix"):
def _setReference(self, value): def _setReference(self, value):
parent = self.getParentValue() parent = self.getParentValue()
self.__dict__.pop('default_reference', None) self.__dict__.pop('default_reference', None)
if value is None:
raise ValueError('Reference is not set.')
if string_type == "prefix": if string_type == "prefix":
new_id = extra_string + value new_id = extra_string + value
elif string_type == "suffix": elif string_type == "suffix":
......
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