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

« back to all changes in this revision

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

  • Committer: Nick Chadwick
  • Date: 2009-03-09 00:15:21 UTC
  • mfrom: (1099.6.4 new-dispatch)
  • mto: This revision was merged to the branch mainline in revision 1162.
  • Revision ID: chadnickbok@gmail.com-20090309001521-dffcygyuyvs2cap0
finished the exercise-ui. It is now ready to be merged with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        if req.user is not None:
53
53
            req.throw_redirect(nexturl)
54
54
 
55
 
        ctx['path'] = ivle.util.make_path('+login') + \
56
 
                         '?' + urllib.urlencode([('url', nexturl)])
 
55
        # Don't give any URL if we want /.
 
56
        if nexturl == '/':
 
57
            query_string = ''
 
58
        else:
 
59
            query_string = '?url=' + urllib.quote(nexturl, safe="/~")
 
60
 
 
61
        ctx['path'] = ivle.util.make_path('+login') + query_string
57
62
 
58
63
        # If this succeeds, the user is invalid.
59
64
        user = ivle.webapp.security.get_user_details(req)
64
69
                # if you are not planning to display a ToS page - the ToS
65
70
                # acceptance process actually calls usrmgt to create the user
66
71
                # jails and related stuff.
67
 
                req.throw_redirect(ivle.util.make_path('+tos') + \
68
 
                        '?' + urllib.urlencode([('url', nexturl)]))
 
72
                req.throw_redirect(ivle.util.make_path('+tos') + query_string)
69
73
            elif user.state == "pending":
70
74
                # FIXME: this isn't quite the right answer, but it
71
75
                # should be more robust in the short term.