Ticket #5394 (closed defect: fixed)
Opened 5 years ago
Last modified 5 years ago
Order user list alphabetically
| Reported by: | dharris <dharris+trac@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | ticket system | Version: | |
| Severity: | normal | Keywords: | ticket sort |
| Cc: | r.sokoll@…, ecarter | ||
| Release Notes: | |||
| API Changes: | |||
Description
In trac.ini, I have restrict_owner = true set so that my users are listed in the "assign to" and "reassign to" fields. But they are shown in a seemingly random order.
I'm attaching a patch to ticket/api.py which sorts the user by username (case-insensitive).
Attachments
Change History
Changed 5 years ago by dharris <dharris+trac@…>
- Attachment api.py.diff added
comment:1 Changed 5 years ago by cboos
- Milestone set to 0.11
- Owner changed from jonas to cboos
I'll integrate that in FieldRefactoring first.
comment:2 Changed 5 years ago by dharris <dharris+trac@…>
The patch I submitted only applies to the dropdown list for initial ticket assignment. The code for generating the list for reassigning a ticket is separate.
Thus there are a few different options here:
- Duplicate the code from the patch I submitted in the render_ticket_action_control method in ConfigurableTicketWorkflow (ticket/default_workflow.py)
- Modify perm.get_users_with_permission to accept an optional keyword parameter. Something like: owners = perm.get_users_with_permission('TICKET_MODIFY', sorted=True)
- Consolidate the code for getting lists for assign and reassign to one method.
Options 2 and 3 are not mutually exclusive.
comment:3 Changed 5 years ago by r.sokoll@…
- Cc r.sokoll@… added
- Milestone changed from 0.11.1 to 0.11
- Type changed from enhancement to defect
Since this is working as expected in the 0.10 branch, it is more a bug than an enhacement.
comment:4 Changed 5 years ago by cboos
- Resolution set to fixed
- Status changed from new to closed
Fixed in r5858. The fix had to be done in default_workflow.py rather than api.py.
comment:5 Changed 5 years ago by ecarter
- Cc ecarter added
- Resolution fixed deleted
- Status changed from closed to reopened
This fixed the list in the actions, but the list on the 'new ticket' page is still random.
comment:6 Changed 5 years ago by ecarter
- Resolution set to fixed
- Status changed from reopened to closed
Fixed in r5897



patch for ticket/api.py to sort user names