Edgewall Software
Modify

Opened 15 years ago

Last modified 9 years ago

#8681 new enhancement

[PATCH] Allow adding usernames to a ticket CC list

Reported by: Mitar Owned by:
Priority: low Milestone: next-major-releases
Component: ticket system Version: 0.11.4
Severity: normal Keywords: patch cc user email
Cc: mmitar@…, exarkun@…, bill@…, Ryan J Ollos Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Allow adding usernames to a ticket CC list instead of e-mail addresses for users which can only select checkbox to add themselves to the CC list (and thus cannot control content). For our setup it would be enough to just add a project-wide configuration switch which would tell Trac whether to prefer usernames or e-mail addresses.

Attachments (0)

Change History (19)

comment:1 by anonymous, 15 years ago

This already seems to be working in trac at http://sourceforge.net/apps/trac shows it as:

Add to Cc: myusername [ ]
and
Remove from Cc: myusername [ ]
when editing a ticket.

Not sure how to configure it though.

stefan

comment:2 by mitar, 15 years ago

That is so only because your username does not have e-mail address set up in Trac. In _toggle_cc method there is this code:

entries = []
email = req.session.get('email', '').strip()
if email:
    entries.append(email)
if req.authname != 'anonymous':
    entries.append(req.authname)

...

if remove:
    action, entry = ('remove', remove[0])
elif add:
    action, entry = ('add', add[0])
return (action, entry, cc_list)

So it uses e-mail address if there is one or username. If I change last lines to:

if remove:
    action, entry = ('remove', remove[0])
elif add:
    action, entry = ('add', add[-1])
return (action, entry, cc_list)

it prefers username.

comment:3 by cboos <cboos@…>, 15 years ago

Milestone: next-minor-0.12.x

Patch welcomed.

comment:4 by exarkun@…, 15 years ago

Cc: exarkun@… added

comment:5 by anonymous, 15 years ago

Should it ever prefer email address? Usernames are more robust (that is, less likely to change). Plus, adding email addresses means more places for spammers to scrape information from. Also, querying for tickets a user is CC'd on becomes harder, because they might have to search for multiple values.

comment:6 by mitar, 15 years ago

I agree. Especially because Trac does not support multiple owners of the ticket. So if multiple persons are working on a ticket they are often listed in CC field. So usernames are also preferred in this case.

comment:7 by mitar, 15 years ago

Patch for this one-line change?

comment:8 by exarkun@…, 15 years ago

Any hints on where the unit tests for the cc manipulation code are?

in reply to:  5 ; comment:9 by Christian Boos, 14 years ago

Keywords: cc user email added
Milestone: next-minor-0.12.xnext-major-0.1X
Priority: normallow

Replying to anonymous:

Should it ever prefer email address? Usernames are more robust (that is, less likely to change)

The idea was that you should better grab an e-mail address when you have one, session data is purged after a while.

In later iterations of the notification subsystem, if the e-mail addresses are stored differently, maybe this could be changed.

in reply to:  9 ; comment:10 by Mitar, 14 years ago

Replying to cboos:

session data is purged after a while.

Even for registered users? Is there a way to disable/configure this?

in reply to:  10 comment:11 by Christian Boos, 14 years ago

Replying to Mitar:

Replying to cboos:

session data is purged after a while.

Even for registered users?

No, you're right, the session is only purged for non authenticated users. So we could indeed already prefer the user name for authenticated users.

comment:12 by Mitar, 14 years ago

I am using on a production Trac system above changes and it works well. So only that small change is necessary to prefer usernames before e-mail address. But probably this should be configurable so there is need for some additional code.

comment:13 by Mitar, 14 years ago

If it is not visible: it is just necessary to change 0 index to -1 index.

comment:14 by bill_b <bill@…>, 12 years ago

Cc: bill@… added

Any chance of this getting into the system soon? Thanks.

comment:15 by Mitar, 12 years ago

I made a plugin for this.

in reply to:  15 comment:16 by bill_b <bill@…>, 12 years ago

Replying to Mitar:

I made a plugin for this.


Thanks - especially for the quick response. That seems to work well. This does seem like a simple enough and desirable feature to have integrated in, but this works for now.

comment:17 by holger-juergs@…, 10 years ago

Summary: Allow adding usernames to a ticket CC list[PATCH] Allow adding usernames to a ticket CC list

using the following PATCH of web_ui.py (under 0.12) solves the problem for me with permission of PrivateTicketsPlugin (#th11862)

  • web_ui.py

    old new  
    647647        of CC status for this user relative to the current `cc_list`."""
    648648        entries = []
    649649        email = req.session.get('email', '').strip()
    650         if email:
    651             entries.append(email)
     650#        if email:
     651#            entries.append(email)
    652652        if req.authname != 'anonymous':
    653653            entries.append(req.authname)
     654        elif email:
     655            entries.append(email)
    654656        else:
    655657            author = get_reporter_id(req, 'author').strip()
    656658            if author and author != 'anonymous':

perhaps there will be some side-effects…

comment:18 by Ryan J Ollos, 10 years ago

Cc: Ryan J Ollos added

comment:19 by figaro, 9 years ago

Keywords: patch added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.