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

« back to all changes in this revision

Viewing changes to ivle/webapp/base/xhtml.py

Don't escape / in paths when they are in +login/+tos URLs.

Also don't put it in the URL at all if it is /.

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
 
192
192
        if req.user is None:
193
193
            # Not logged in. Redirect to login page.
194
 
            req.throw_redirect('/+login?' + 
195
 
                               urllib.urlencode([('url', req.uri)]))
 
194
            if req.uri == '/':
 
195
                query_string = ''
 
196
            else:
 
197
                query_string = '?url=' + urllib.quote(req.uri, safe="/~")
 
198
            req.throw_redirect('/+login' + query_string)
196
199
 
197
200
        req.status = 403