James, sorry for taking a while to reply. I found the following duplication of logic:
== webapp/publication.py ==
def callObject(self, request, ob):
# Don't render any content on a redirect.
if request.response.getStatus() in [301, 302, 303, 307]:
return ''
== webapp/generalform.py ==
class NoRenderingOnRedirect:
"""Mix-in for not rendering the page on redirects."""
def __call__(self):
# Call update() here instead of from the template to avoid
# rendering the page on redirects. self.update()
if self.request.response.getStatus() in [301, 302, 303]:
# Don't render the page on redirects.
return u''
== webapp/publisher.py ==
def _isRedirected(self):
"""Return True if a redirect was requested.
Check if the response status is one of 301, 302, 303 or 307.
"""
return self.request.response.getStatus() in [301, 302, 303, 307]
== ftests/_launchpadformharness.py ==
def wasRedirected(self):
return self.request.response.getStatus() in [302, 303]
James, sorry for taking a while to reply. I found the following duplication of logic:
== webapp/ publication. py ==
def callObject(self, request, ob):
# Don't render any content on a redirect. response. getStatus( ) in [301, 302, 303, 307]:
if request.
return ''
== webapp/ generalform. py ==
class NoRenderingOnRe direct:
"""Mix-in for not rendering the page on redirects."""
def __call__(self):
self.update( ) response. getStatus( ) in [301, 302, 303]:
# Call update() here instead of from the template to avoid
# rendering the page on redirects.
if self.request.
# Don't render the page on redirects.
return u''
== webapp/publisher.py ==
def _isRedirected( self):
"""Return True if a redirect was requested.
Check if the response status is one of 301, 302, 303 or 307. response. getStatus( ) in [301, 302, 303, 307]
"""
return self.request.
== ftests/ _launchpadformh arness. py ==
def wasRedirected( self): response. getStatus( ) in [302, 303]
return self.request.