Replace underscores with whitespace when creating action label from action name
|Reported by:||Ryan J Ollos||Owned by:||Ryan J Ollos|
If not specified, the
Description (last modified by )
Consider a workflow action such as the following:
may_reassign = new,assigned,accepted,reopened -> assigned may_reassign.operations = may_set_owner may_reassign.permissions = TICKET_MODIFY may_reassign.set_owner =
If I want the action name to look nice, I must add another attribute:
may_reassign.name = may reassign
What would be the downside to doing a simple replacement?
diff --git a/trac/ticket/default_workflow.py b/trac/ticket/default_workflow.py index f9c595e..f35ca4f 100644
a b def parse_workflow_config(rawactions): 67 67 for action, attributes in actions.items(): 68 68 # Default the 'name' attribute to the name used in the ini file 69 69 if 'name' not in attributes: 70 attributes['name'] = action 70 attributes['name'] = action 71 71 # If not specified, an action is not the default. 72 72 attributes['default'] = int(attributes.get('default', 0)) 73 73 # If operations are not specified, that means no operations
The only downside I can think of is when the user really wants an underscore in the name, but I guess that to be a rather infrequent occurrence.
The same replacement could be applied to TracTicketsCustomFields field name.
Anyway, those are just small things and not too important.