Am 24.01.2006 um 16:12 schrieb Christian Boos:
Kilian CAVALOTTI wrote:
On Monday 23 January 2006 18:23, Kilian CAVALOTTI wrote:
On Monday 23 January 2006 18:17, Emmanuel Blot wrote:
Have a look at the notification unit tests
(/trac/tests/notification.py). These tests have been introduced in
[2799], so you need checkout the trunk to get the code (not
available
in 0.9.x)
Great, thanks for the pointer!
Well, actually, it was enough to create self.env.href and
self.env.abs_href Href objects before invoking TicketNotifyEmail
(self.env)
I should have been able to respond to that earlier, as I have the
same issue
in InterTrac, when I want to access a sibling environment for the
first time.
I think we set env.href in the Environment constructor, instead of
doing this in trac/web/main.py:
def dispatch_request(path_info, req, env):
...
env.href = Href(req.cgi_location)
env.abs_href = Href(req.base_url)
Anyway, that's not safe.
The Href objects shouldn't even be members of the environment in the
first place, but members of the request. The notification code is one
of the reasons I didn't yet refactor that.
I think notifications should only be sent (or only include links)
when the [trac]base_url option is set. Otherwise, the URLs used in
mails depend on which host name the user is using to access Trac,
which can vary if there are aliases.
Cheers,
Chris
--
Christopher Lenz
cmlenz at gmx.de
http://www.cmlenz.net/
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev