changequery and redirect do not go well together

Bug #118234 reported by Anand Chitipothu on 2007-06-01
2
Affects Status Importance Assigned to Milestone
web.py
High
Anand Chitipothu

Bug Description

Both web.changequery and web.redirect adds homepath to the url.

    def test_changequery_redirect(self):
        fakerequest('GET', '/foo', homepath="/test")
        web.redirect(web.changequery(a=1))
        self.assertEquals(get_header('Location'), '/test/foo?a=1')

FAIL: test_changequery_redirect (__main__.WebpyTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "fake.py", line 70, in test_changequery_redirect
    self.assertEquals(get_header('Location'), '/test/foo?a=1')
AssertionError: '/test/test/foo?a=1' != '/test/foo?a=1'

Anand Chitipothu (anandology) wrote :

I think changequery should not worry about homepath at all.
This solves the problem, but it might create some backward compatibility issues.

Changed in webpy:
assignee: nobody → anandology
importance: Undecided → High

> I think changequery should not worry about homepath at all.
> This solves the problem, but it might create some backward compatibility issues.

Yeah; I think you're right. People should pass it to either redirect
or the template's url function if they need proper URLs.

Anand Chitipothu (anandology) wrote :

fixed in r171.

Changed in webpy:
status: New → Fix Committed
Changed in webpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers