workflows: really log invalid status detection (#23894)

This commit is contained in:
Thomas NOËL 2018-05-17 15:16:55 +02:00 committed by Frédéric Péters
parent c8a06c48f3
commit 579b1c17e3
1 changed files with 3 additions and 4 deletions

View File

@ -1700,15 +1700,14 @@ class WorkflowStatusItem(XmlSerialisable):
return [previous_status]
return []
try:
return [x for x in self.parent.parent.possible_status if x.id == self.status]
except IndexError:
targets = [x for x in self.parent.parent.possible_status if x.id == self.status]
if not targets:
get_publisher().get_app_logger().error(
'reference to invalid status in workflow %s, status %s, item %s' % (
self.parent.parent.name,
self.parent.name,
self.description))
return []
return targets
def get_jump_label(self):
'''Return the label to use on a workflow graph arrow'''