Pylons/pyramid — Issue #433: provide better example of how to use forbidden exception in tutorials
Author: mmerickel
Created: 2012-02-11 02:03:33+00:00
State: open

Currently the tutorial describes a poor way to use the forbidden exception. The exception should be caught by a dedicated view that can handle authentication because usually it's a bad idea to display the login view for a user who is already logged in... which is what the current code does. Also, what's the point of having a "login url" if we are just displaying the login template at the url of the content, instead of redirecting the user to the login url.

http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/tutorials/wiki2/authorization.html#adding-login-and-logout-views