In workflow visualisation, replace render_as_line() by label when possible

This commit is contained in:
Benjamin Dauvergne 2011-06-14 17:33:12 +02:00 committed by Frédéric Péters
parent 876a95b893
commit 71ae10bdd7
1 changed files with 2 additions and 1 deletions

View File

@ -109,7 +109,8 @@ def graphviz(workflow, url_prefix='', select=None, svg=True,
next_id = status.id
print >>out, 'status%s -> status%s' % (i, next_id)
url = 'status/%s/items/%s/' % (i, item.id)
label = textwrap.fill(item.render_as_line().replace('"', '\\"'), 20)
label = getattr(item, 'label', False) or item.render_as_line()
label = textwrap.fill(label.replace('"', '\\"'), 20)
label = label.replace('\n', '\\n')
print >>out, '[label="%s"' % label,
if select == '%s-%s' % (i, item.id):