summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2012-11-12 11:53:18 -0600
committerMichael Merickel <michael@merickel.org>2012-11-12 11:53:18 -0600
commitcdfa9d1df1bd7aa53921a0ebaa202272e684eb2e (patch)
treeb6c18b81c7a74f933f1606a8d6c7f7f0f6b18a17
parentd8d3a919f6a2a17db7ef20cea9a867bc0ec714a5 (diff)
parent18a9aed5810a5680fc027b8c55c10bd67616d1b0 (diff)
downloadpyramid-cdfa9d1df1bd7aa53921a0ebaa202272e684eb2e.tar.gz
pyramid-cdfa9d1df1bd7aa53921a0ebaa202272e684eb2e.tar.bz2
pyramid-cdfa9d1df1bd7aa53921a0ebaa202272e684eb2e.zip
Merge branch 'fix.516' of rob0t7/pyramid into pull.720
-rw-r--r--CHANGES.txt7
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--docs/narr/hooks.rst13
3 files changed, 17 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index e40312c34..c28597f0e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -81,6 +81,13 @@ Internals
because that package should never be imported from non-Pyramid code.
TopologicalSorter is still not an API, but may become one.
+Documentation
+-------------
+
+- Updated the hooks narrative documentation to reflect the fact that
+ the context passed into the view callable is actually the instance of
+ Exception called when a Forbidden Exception is envoked
+
1.4a3 (2012-10-26)
==================
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index d03da3e62..34d904d0f 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -188,3 +188,5 @@ Contributors
- Domen Kozar, 2012/09/11
- David Gay, 2012/09/16
+
+- Robert Jackiewicz, 2012/11/12
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index 96fa77a07..ea75e5fe4 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -180,11 +180,14 @@ as a forbidden view:
config.scan()
Like any other view, the forbidden view must accept at least a ``request``
-parameter, or both ``context`` and ``request``. The ``context`` (available
-as ``request.context`` if you're using the request-only view argument
-pattern) is the context found by the router when the view invocation was
-denied. The ``request`` is the current :term:`request` representing the
-denied action.
+parameter, or both ``context`` and ``request``. If a forbidden view
+callable accepts both ``context`` and ``request``, the HTTP Exception is passed
+as context. The ``context`` as found by the router when view was
+denied (that you normally would expect) is available as
+``request.context``. The ``request`` is the current :term:`request`
+representing the denied action.
+
+
Here's some sample code that implements a minimal forbidden view: