summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-05-25 00:27:08 +0000
committerChris McDonough <chrism@agendaless.com>2009-05-25 00:27:08 +0000
commit267f2db66f514db43d0801237213799cd6797ee4 (patch)
treeae13868d50a54f534bf594acf8b109d49ad60e09 /docs
parent6db0d49fb607f4dc55e8612e4a658856c1afbf8b (diff)
downloadpyramid-267f2db66f514db43d0801237213799cd6797ee4.tar.gz
pyramid-267f2db66f514db43d0801237213799cd6797ee4.tar.bz2
pyramid-267f2db66f514db43d0801237213799cd6797ee4.zip
Change the semantics of IForbiddenAppFactory.
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/hooks.rst12
1 files changed, 5 insertions, 7 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index 5eab5e41e..aefa95046 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -145,13 +145,10 @@ factory:
.. code-block:: python
- from webob.exc import HTTPForbidden
+ from repoze.bfg.chameleon_zpt import render_template_to_response
- class MyForbidden(HTTPForbidden):
- pass
-
- def forbidden_app_factory():
- return MyForbidden
+ def forbidden_app_factory(context, request):
+ return render_template_to_response('templates/login_form.pt')
.. note:: When an Forbidden application factory is invoked, it is
passed the WSGI environ and the WSGI ``start_response`` handler by
@@ -159,7 +156,8 @@ factory:
``repoze.bfg.message`` that has a value explaining why the action
was forbidden. This error will be different when the
``debug_authorization`` environment setting is true than it is when
- it is false.
+ it is false. A WebOb ``Response`` object is a valid WSGI
+ application, by the way.
.. warning:: the default forbidden application factory sends a
response with a ``401 Unauthorized`` status code for backwards