workflows: fix display of action assigned to "logged users" role (#54032)

This commit is contained in:
Frédéric Péters 2021-05-17 17:46:56 +02:00
parent 8e5b008282
commit b278591f25
2 changed files with 25 additions and 1 deletions

View File

@ -3123,6 +3123,30 @@ def test_workflow_email_line_details(pub):
assert sendmail.get_line_details() == 'to computed value'
def test_choice_line_details(pub):
workflow = Workflow(name='choice')
st1 = workflow.add_status('Status1', 'st1')
choice = ChoiceWorkflowStatusItem()
choice.parent = st1
assert choice.get_line_details() == 'not completed'
choice.status = 'wf-%s' % st1.id
choice.label = 'foobar'
assert choice.get_line_details() == '"foobar", to Status1'
role = pub.role_class(name='foorole')
role.store()
choice.by = [role.id]
assert choice.get_line_details() == '"foobar", to Status1, by foorole'
choice.by = ['_receiver']
assert choice.get_line_details() == '"foobar", to Status1, by Recipient'
choice.by = ['logged-users']
assert choice.get_line_details() == '"foobar", to Status1, by Logged Users'
def test_workflow_roles(pub, emails):
pub.substitutions.feed(MockSubstitutionVariables())

View File

@ -2460,7 +2460,7 @@ def render_list_of_roles(workflow, roles):
role_label = get_role_translation_label(workflow, r)
if role_label:
t.append(role_label)
return ', '.join(t)
return ', '.join([str(x) for x in t])
item_classes = []