Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10171 closed defect (fixed)

CC parsing should use NotifyEmail.addrsep_re.split(ticket['cc'])

Reported by: Mitar Owned by: Daniel Kahn Gillmor
Priority: normal Component: SensitiveTicketsPlugin
Severity: normal Keywords:
Cc: Mitar Trac Release: 0.12

Description (last modified by Ryan J Ollos)

CC parsing should use NotifyEmail.addrsep_re.split(ticket['cc']) as this is what it is used by Trac:

from trac.notification import NotifyEmail

...

        if not username or username == 'anonymous':
            return False
        return (self.allow_owner and (ticket['owner'] == username)) or \
            (self.allow_reporter and (ticket['reporter'] == username)) or \
            (self.allow_cc and username in NotifyEmail.addrsep_re.split(ticket['cc']))

Attachments (0)

Change History (3)

comment:1 Changed 5 years ago by Daniel Kahn Gillmor

Resolution: fixed
Status: newclosed

(In [11906]) use NotifyEmail.addrsep_re to parse cc field (Closes #10171)

comment:2 Changed 5 years ago by Ryan J Ollos

Has this been tested? It seems that from trac.notification import NotifyEmail is missing.

There's also the Chrome.cc_list function, which is more directly intended for what you are trying to accomplish, I think.

from trac.web.chrome import Chrome

...

... username in Chrome(self.env).cc_list(ticket['cc'])

comment:3 Changed 5 years ago by Ryan J Ollos

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Daniel Kahn Gillmor.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.