workflows: add fallbacks for exporting (very) old workflows (#34705)

This commit is contained in:
Frédéric Péters 2019-07-17 07:01:11 +02:00
parent c26cfd1734
commit 14d02d3afd
1 changed files with 2 additions and 2 deletions

View File

@ -1305,7 +1305,7 @@ class WorkflowGlobalAction(object):
include_id=include_id))
triggers = ET.SubElement(status, 'triggers')
for trigger in self.triggers:
for trigger in self.triggers or []:
triggers.append(trigger.export_to_xml(charset=charset,
include_id=include_id))
@ -1346,7 +1346,7 @@ class WorkflowCriticalityLevel(object):
def export_to_xml(self, charset, include_id=False):
level = ET.Element('criticality-level')
ET.SubElement(level, 'id').text = unicode(self.id, charset)
ET.SubElement(level, 'id').text = unicode(self.id, charset) if self.id else ''
ET.SubElement(level, 'name').text = unicode(self.name, charset)
if self.colour:
ET.SubElement(level, 'colour').text = unicode(self.colour, charset)