Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10171 closed defect (fixed)

CC parsing should use NotifyEmail.addrsep_re.split(ticket['cc']) — at Version 3

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']))

Change History (3)

comment:1 Changed 12 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 12 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 12 years ago by Ryan J Ollos

Description: modified (diff)
Note: See TracTickets for help on using tickets.