Modify ↓
#12660 closed defect (fixed)
EmailDistributor.resolvers option should set to include_missing=False
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.2.1 |
Component: | notification | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
|
||
API Changes: | |||
Internal Changes: |
Description
EmailDistributor.resovlers
returns all components which are implemented IEmailAddressResolver
. The behavior is not useful. I consider we should use only configured resolvers.
>>> from trac.test import EnvironmentStub >>> from trac.loader import load_components >>> from trac.notification.mail import EmailDistributor >>> from trac.notification.tests.mail import TestEmailAddressResolver >>> env = EnvironmentStub() >>> EmailDistributor(env).resolvers [<Component trac.notification.mail.SessionEmailResolver>, <Component trac.notification.tests.mail.TestEmailAddressResolver>]
Also, another issue is that include_missing
return the option's documentation string.
>>> EmailDistributor.resolvers.include_missing 'Comma seperated list of email resolver components in the order\n they will be called. If an email address is resolved, the remaining\n resolvers will not be called.\n '
-
trac/notification/mail.py
diff --git a/trac/notification/mail.py b/trac/notification/mail.py index 6878fbebf..c3421eaf9 100644
a b class EmailDistributor(Component): 280 280 resolvers = OrderedExtensionsOption('notification', 281 281 'email_address_resolvers', IEmailAddressResolver, 282 282 'SessionEmailResolver', 283 """Comma seperated list of email resolver components in the order 283 include_missing=False, 284 doc="""Comma seperated list of email resolver components in the order 284 285 they will be called. If an email address is resolved, the remaining 285 286 resolvers will not be called. 286 287 """)
Attachments (0)
Change History (3)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Owner: | set to |
---|---|
Release Notes: | modified (diff) |
Status: | new → assigned |
comment:3 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Sounds good. I think this was copied from Announcer.
I'm surprised the default is
include_missing=True
. RequestDispatcher.filters seems to be the only other place in Trac where that default is used. I'm not sure why that is desired.