summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-12 01:43:09 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-12 01:43:09 +0000
commitc37d6ac18aaeb839fd38b2ef4a1a66b264ba3888 (patch)
tree6bfef51ec8d122a8be976e4d3c8257858b15ad24
parent06173dbf039e0fc87878f32c8937112c4cb8fe86 (diff)
downloadpyramid-c37d6ac18aaeb839fd38b2ef4a1a66b264ba3888.tar.gz
pyramid-c37d6ac18aaeb839fd38b2ef4a1a66b264ba3888.tar.bz2
pyramid-c37d6ac18aaeb839fd38b2ef4a1a66b264ba3888.zip
- Use ``alsoProvides`` in the urldispatch module to attach an
interface to the request rather than ``directlyProvides`` to avoid disturbing interfaces set in a NewRequest event handler.
-rw-r--r--CHANGES.txt7
-rw-r--r--repoze/bfg/urldispatch.py6
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index fa09f8089..f7a979ea1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,13 @@
Next release
============
+Bug Fixes
+---------
+
+- Use ``alsoProvides`` in the urldispatch module to attach an
+ interface to the request rather than ``directlyProvides`` to avoid
+ disturbing interfaces set in a NewRequest event handler.
+
Documentation
-------------
diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py
index 373c11f0b..7b0d4dbb7 100644
--- a/repoze/bfg/urldispatch.py
+++ b/repoze/bfg/urldispatch.py
@@ -1,7 +1,7 @@
import re
from urllib import unquote
-from zope.interface import directlyProvides
+from zope.interface import alsoProvides
from repoze.bfg.interfaces import IRouteRequest
@@ -50,7 +50,7 @@ class RoutesRootFactory(object):
# passed to it be a request, instead of an environ, as it
# uses both the ``registry`` attribute of the request, and
# if a route is found, it decorates the object with an
- # interface using directlyProvides. However, existing app
+ # interface using alsoProvides. However, existing app
# code "in the wild" calls the root factory explicitly
# with a dictionary argument (e.g. a subscriber to
# WSGIApplicationCreatedEvent does
@@ -83,7 +83,7 @@ class RoutesRootFactory(object):
request.matchdict = match
iface = registry.queryUtility(IRouteRequest, name=route.name)
if iface is not None:
- directlyProvides(request, iface)
+ alsoProvides(request, iface)
factory = route.factory or self.default_root_factory
return factory(request)