Edgewall Software
Modify

Opened 17 years ago

Closed 5 months ago

Last modified 5 months ago

#8681 closed enhancement (fixed)

Tickets do not allow subscribing as a user rather than via hardcoded email address

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, chealer@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Philippe Cloutier <chealer@…>)

Allow adding usernames to a ticket CC list instead of e-mail addresses for users which only have the permission to select a checkbox to add themselves to the CC list (and thus cannot control whether to add an address or a user identifier). 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 (21)

comment:1 by anonymous, 17 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, 17 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@…>, 17 years ago

Milestone: next-minor-0.12.x

Patch welcomed.

comment:4 by exarkun@…, 16 years ago

Cc: exarkun@… added

comment:5 by anonymous, 16 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, 16 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, 16 years ago

Patch for this one-line change?

comment:8 by exarkun@…, 16 years ago

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

in reply to:  5 ; comment:9 by Christian Boos, 16 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, 16 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, 16 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, 16 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, 16 years ago

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

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

Cc: bill@… added

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

comment:15 by Mitar, 14 years ago

I made a plugin for this.

in reply to:  15 comment:16 by bill_b <bill@…>, 14 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@…, 12 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, 12 years ago

Cc: Ryan J Ollos added

comment:19 by figaro, 11 years ago

Keywords: patch added

comment:20 by Philippe Cloutier <chealer@…>, 5 months ago

Cc: chealer@… added
Description: modified (diff)
Priority: lowhigh
Resolution: fixed
Status: newclosed
Summary: [PATCH] Allow adding usernames to a ticket CC listTickets do not allow subscribing as a user rather than via hardcoded email address

Thank you for reporting Mitar, and thanks for the patch Holger

This is clearly an important issue, but if my reading of the code is right, this is solved in 1.4 and above, thanks to Ryan J Ollos’s changeset 15737, which effectively applies the proposed patch.

This comment is from Philippe "Chealer" Cloutier. I am subscribing to this ticket, but notifications seem to be broken, and I struggle to display my full email address or link to my contact information from this comment. My email address is available on Kune ni povos’s contact page. All of my comments and contributions in this ticket are offered under the terms of CC0 1.0 (unless otherwise noted).

in reply to:  20 comment:21 by Jun Omae, 5 months ago

Priority: highlow

This is clearly an important issue, but if my reading of the code is right, this is solved in 1.4 and above, thanks to Ryan J Ollos’s changeset 15737, which effectively applies the proposed patch.

That is fixed in [15736] (comment:4:ticket:12724, in Trac 1.2.3).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


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