set_owner_to_self should use author field of form
|Reported by:||Ryan J Ollos||Owned by:||Ryan J Ollos|
The user email and name of an unauthenticated session are used to populate the new ticket owner field in the
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.
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 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=)) 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 365 367 updated['owner'] = newowner 366 368 elif operation == 'set_owner_to_self': 367 updated['owner'] = req.authname 369 updated['owner'] = 368 370 elif operation == 'del_resolution': 369 371 updated['resolution'] = '' 370 372 elif operation == 'set_resolution':
Change History (10)
comment:1 by , 9 years ago
|Summary:||set_owner_to_self should use author from form or prefs → set_owner_to_self should use author field of form|
comment:8 by , 8 years ago
|Release Notes:||modified (diff)|