changequery and redirect do not go well together

Bug #118234 reported by Anand Chitipothu
2
Affects Status Importance Assigned to Milestone
web.py
Fix Released
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'

Revision history for this message
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
Revision history for this message
Aaron Swartz (aaronsw) wrote : Re: [Bug 118234] Re: changequery and redirect do not go well together

> 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.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.