summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodwillcoding <goodwillcoding@webhippo.net>2013-01-20 06:17:19 -0800
committergoodwillcoding <goodwillcoding@webhippo.net>2013-01-20 06:17:19 -0800
commit6c07a0ef579fea47c1e156ad6f4124ee11673980 (patch)
tree2aeb0bfbe42b45247963cd5ec9ff1d02f8b4da98
parent6f17f6945a3592a24bc3177f43084cd037bc1a98 (diff)
parentff9edd2492f931f6e9d51ee3f04bbb400d0d98ca (diff)
downloadpyramid-6c07a0ef579fea47c1e156ad6f4124ee11673980.tar.gz
pyramid-6c07a0ef579fea47c1e156ad6f4124ee11673980.tar.bz2
pyramid-6c07a0ef579fea47c1e156ad6f4124ee11673980.zip
Merge pull request #806 from tshepang/modernise
user newer API in the example thank you
-rw-r--r--pyramid/authentication.py5
1 files changed, 2 insertions, 3 deletions
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))