Commits

Christian Boos committed 7f93efc

1.0.2dev: add a hint about the owner for the `leave_status` operation.

This is a convenience reminder about the current owner (or lack
thereof).

Patch by Ethan Jucovy <ethan.jucovy@gmail.com> on #11090, thanks!

  • Participants
  • Parent commits 9a70f12
  • Branches 1.0-stable

Comments (0)

Files changed (1)

trac/ticket/default_workflow.py

         this_action = self.actions[action]
         status = this_action['newstate']
         operations = this_action['operations']
-        current_owner = ticket._old.get('owner', ticket['owner'] or '(none)')
+        current_owner_or_empty = ticket._old.get('owner', ticket['owner'])
+        current_owner = current_owner_or_empty or '(none)'
         if not (Chrome(self.env).show_email_addresses
                 or 'EMAIL_VIEW' in req.perm(ticket.resource)):
             format_user = obfuscate_email_address
             control.append(_('as %(status)s ',
                              status= ticket._old.get('status',
                                                      ticket['status'])))
+            if len(operations) == 1:
+                hints.append(_("The owner will remain %(current_owner)s",
+                               current_owner=current_owner)
+                             if current_owner_or_empty else
+                             _("The ticket will remain with no owner"))
         else:
             if status != '*':
                 hints.append(_("Next status will be '%(name)s'", name=status))