goodwillcoding
2013-01-20 6c07a0ef579fea47c1e156ad6f4124ee11673980
Merge pull request #806 from tshepang/modernise

user newer API in the example
thank you
1 files modified
5 ■■■■■ changed files
pyramid/authentication.py 5 ●●●●● patch | view | raw | blame | history
pyramid/authentication.py
@@ -1075,12 +1075,11 @@
    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))