~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/errors.py

Add an XHTMLUnauthorizedView which redirects unauthenticated users to the
login page if a page raises an Unauthorized. Alter UserSettingsView to raise
one in the right cases, for testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    codename = 'Bad Request'
25
25
    code = 400
26
26
 
 
27
class Unauthorized(HTTPError):
 
28
    codename = 'Unauthorized'
 
29
    code = 401
 
30
 
27
31
class Forbidden(HTTPError):
28
32
    codename = 'Forbidden'
29
33
    code = 403