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

« back to all changes in this revision

Viewing changes to ivle/webapp/security/views.py

Allow any authenticated (even invalid) user to use the logout view.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    pass
27
27
 
28
28
import ivle.util
 
29
import ivle.dispatch.login
29
30
from ivle.auth import authenticate, AuthError
30
31
from ivle.webapp.base.xhtml import XHTMLView
31
32
from ivle.webapp.base.plugins import CookiePlugin
130
131
    template = 'logout.html'
131
132
 
132
133
    def authorize(self, req):
133
 
        return req.user is not None
 
134
        # This can be used by any authenticated user, even if they haven't
 
135
        # accepted the ToS yet.
 
136
        return ivle.dispatch.login.get_user_details(req) is not None
134
137
 
135
138
    def populate(self, req, ctx):
136
139
        if req.method == "POST":