Opened 10 years ago
Last modified 9 years ago
#11418 closed enhancement
set_owner_to_self should use author from form or prefs — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.3 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | workflow |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When changing a ticket the author field is populated from prefs, that author field value can be replaced by the user, and the value of the author field is used as the ticket change author. However, when accepting a ticket, the set_owner_to_self
action does not use the author field when consider who the ticket should be assigned to.
The following patch has been lightly tested, but may be a starting point in aligning the behavior of the workflow with the rest of the ticket form.
-
trac/ticket/default_workflow.py
diff --git a/trac/ticket/default_workflow.py b/trac/ticket/default_workflow.py index 952437a..52d1a63 100644
a b from trac.env import IEnvironmentSetupParticipant 29 29 from trac.perm import PermissionSystem 30 30 from trac.ticket.api import ITicketActionController, TicketSystem 31 31 from trac.ticket.model import Resolution 32 from trac.util import get_reporter_id 32 33 from trac.util.text import obfuscate_email_address 33 34 from trac.util.translation import _, tag_, cleandoc_ 34 35 from trac.web.chrome import Chrome, add_script, add_script_data … … Read TracWorkflow for more information (don't forget to 'w 285 286 "%(current_owner)s to the selected user", 286 287 current_owner=current_owner)) 287 288 elif 'set_owner_to_self' in operations and \ 288 ticket._old.get('owner', ticket['owner']) != req.authname: 289 ticket._old.get('owner', ticket['owner']) != \ 290 get_reporter_id(req, 'author'): 289 291 hints.append(_("The owner will be changed from %(current_owner)s " 290 292 "to %(authname)s", current_owner=current_owner, 291 authname= req.authname))293 authname=get_reporter_id(req, 'author'))) 292 294 if 'set_resolution' in operations: 293 295 if 'set_resolution' in this_action: 294 296 resolutions = [x.strip() for x in … … Read TracWorkflow for more information (don't forget to 'wik 364 366 newowner = newowner[0] 365 367 updated['owner'] = newowner 366 368 elif operation == 'set_owner_to_self': 367 updated['owner'] = req.authname369 updated['owner'] = get_reporter_id(req, 'author') 368 370 elif operation == 'del_resolution': 369 371 updated['resolution'] = '' 370 372 elif operation == 'set_resolution':
Note:
See TracTickets
for help on using tickets.