Opened 7 years ago
Last modified 5 years ago
#12808 closed enhancement
Allow permission groups to be CC'ed — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.6 |
Component: | notification | Version: | |
Severity: | normal | Keywords: | subscriber group |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Discussed in trac-users:Aly_eHLw7J0/GmzimnwjAAAJ. It would be useful to allow permission groups to be CC'ed, at the very least to improvise until we have a real user and group system in Trac.
-
trac/ticket/notification.py
diff --git a/trac/ticket/notification.py b/trac/ticket/notification.py index 92957d016..589fdbb41 100644
a b from trac.notification.compat import NotifyEmail 29 29 from trac.notification.mail import (RecipientMatcher, create_message_id, 30 30 get_from_author, set_header) 31 31 from trac.notification.model import Subscription 32 from trac.perm import PermissionSystem 32 33 from trac.ticket.api import translation_deactivated 33 34 from trac.ticket.model import Ticket 34 35 from trac.util.datefmt import (datetime_now, format_date_or_datetime, … … class CarbonCopySubscriber(Component): 462 463 if 'fields' in event.changes and 'cc' in event.changes['fields']: 463 464 cc_set.update(to_set(event.changes['fields']['cc']['old'])) 464 465 466 # Get members of permission groups 467 groups = PermissionSystem(self.env).get_groups_dict() 468 for cc in cc_set.copy(): 469 if cc in groups: 470 cc_set.remove(cc) 471 cc_set.update(groups[cc]) 472 465 473 matcher = RecipientMatcher(self.env) 466 474 klass = self.__class__.__name__ 467 475 sids = set()
I don't see much downside to the patch provided that we don't intend to adopt a naming convention for groups later on, which could result in backward incompatible changes.
Note:
See TracTickets
for help on using tickets.