admin: update workflow functions sort for python3 (#36515)

This commit is contained in:
Frédéric Péters 2019-11-13 19:58:16 +01:00
parent 5395f9255f
commit 71f4a0fd3e
2 changed files with 2 additions and 2 deletions

View File

@ -484,7 +484,7 @@ class FormDefPage(Directory):
if not self.formdef.workflow_roles:
self.formdef.workflow_roles = {}
workflow_roles = list((self.formdef.workflow.roles or {}).items())
workflow_roles.sort(key=lambda x: -1 if x[0] == '_receiver' else misc.simplify(x[1]))
workflow_roles.sort(key=lambda x: '' if x[0] == '_receiver' else misc.simplify(x[1]))
for (wf_role_id, wf_role_label) in workflow_roles:
role_id = self.formdef.workflow_roles.get(wf_role_id)
if role_id:

View File

@ -1448,7 +1448,7 @@ class WorkflowPage(Directory):
r += htmltext('</h3>')
r += htmltext('<ul id="roles-list" class="biglist">')
workflow_roles = list((self.workflow.roles or {}).items())
workflow_roles.sort(key=lambda x: -1 if x[0] == '_receiver' else misc.simplify(x[1]))
workflow_roles.sort(key=lambda x: '' if x[0] == '_receiver' else misc.simplify(x[1]))
for key, label in workflow_roles:
r += htmltext('<li class="biglistitem">')
if not str(self.workflow.id).startswith('_'):