diff options
| -rw-r--r-- | CHANGES.txt | 2 | ||||
| -rw-r--r-- | repoze/bfg/urldispatch.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 759d84f47..0986820e0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,7 +5,7 @@ Features -------- - Added documentation to the URL Dispatch chapter about how to catch - the root URL. + the root URL using a ZCML ``route`` directive. Bug Fixes --------- diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py index d3baf6d9f..ead8876de 100644 --- a/repoze/bfg/urldispatch.py +++ b/repoze/bfg/urldispatch.py @@ -115,6 +115,9 @@ class RoutesContextNotFound(object): def __init__(self, msg): self.msg = msg +_notfound = RoutesContextNotFound( + 'Routes context cannot be found and no fallback "get_root"') + class RoutesRootFactory(Mapper): """ The ``RoutesRootFactory`` is a wrapper for the ``get_root`` callable passed in to the repoze.bfg ``Router`` at initialization @@ -193,11 +196,8 @@ class RoutesRootFactory(Mapper): return context if self.get_root is None: - # no fallback get_root - return RoutesContextNotFound( - 'Routes context cannot be found and no fallback "get_root"') + return _notfound - # fall back to original get_root return self.get_root(environ) class RoutesModelTraverser(object): |
