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

« back to all changes in this revision

Viewing changes to ivle/webapp/tos/__init__.py

Move ivle.dispatch.login.get_user_details() to ivle.webapp.security.

That empties ivle.dispatch.login, so it dies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
This is mainly for the benefit of the link in ivle.webapp.help."""
23
23
 
24
24
import ivle.util
25
 
import ivle.dispatch.login
 
25
import ivle.webapp.security
26
26
from ivle.webapp.base.xhtml import XHTMLView
27
27
from ivle.webapp.base.plugins import ViewPlugin, MediaPlugin
28
28
 
40
40
        # 'no_agreement'. In that case, req.user will be None, so we have
41
41
        # to get it ourselves.
42
42
        if req.user is None:
43
 
            self.user = ivle.dispatch.login.get_user_details(req)
 
43
            self.user = ivle.webapp.security.login.get_user_details(req)
44
44
            self.mode = 'accept'
45
45
            self.template = 'accept.html'
46
46
        else:
51
51
    def authorize(self, req):
52
52
        # This can be used by any authenticated user, even if they haven't
53
53
        # accepted the ToS yet.
54
 
        return ivle.dispatch.login.get_user_details(req) is not None
 
54
        return ivle.webapp.security.get_user_details(req) is not None
55
55
 
56
56
    def populate(self, req, ctx):
57
57
        ctx['text'] = ivle.util.get_terms_of_service()