Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#10171 closed defect (fixed)

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

Reported by: mitar Owned by: dkgdkg
Priority: normal Component: SensitiveTicketsPlugin
Severity: normal Keywords:
Cc: mmitar@… Trac Release: 0.12

Description (last modified by rjollos)

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 2 years ago by dkgdkg

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:2 Changed 2 years ago by rjollos

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 2 years ago by rjollos

  • Description modified (diff)

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from dkgdkg. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.