workflows: fix display of action assigned to "logged users" role (#54032)
This commit is contained in:
parent
8e5b008282
commit
b278591f25
|
@ -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())
|
||||
|
||||
|
|
|
@ -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 = []
|
||||
|
|
Loading…
Reference in New Issue