diff options
| -rw-r--r-- | docs/glossary.rst | 2 | ||||
| -rw-r--r-- | pyramid/authentication.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/docs/glossary.rst b/docs/glossary.rst index 5b165db0a..0036d045b 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -689,7 +689,7 @@ Glossary non-C based Python implementations. View Lookup - The act of finding and invoking the "best" :term:`view callable` + The act of finding and invoking the "best" :term:`view callable`, given a :term:`request` and a :term:`context` resource. Resource Location diff --git a/pyramid/authentication.py b/pyramid/authentication.py index 08d283acc..4f6ed2c1d 100644 --- a/pyramid/authentication.py +++ b/pyramid/authentication.py @@ -1075,12 +1075,11 @@ class BasicAuthAuthenticationPolicy(CallbackAuthenticationPolicy): register a view that will send a Basic Auth challenge to the user whenever there is an attempt to call a view which results in a Forbidden response:: - from pyramid.httpexceptions import HTTPForbidden from pyramid.httpexceptions import HTTPUnauthorized from pyramid.security import forget - from pyramid.view import view_config + from pyramid.view import forbidden_view_config - @view_config(context=HTTPForbidden) + @forbidden_view_config() def basic_challenge(request): response = HTTPUnauthorized() response.headers.update(forget(request)) |
