[Zope] Strange redirect problem -- can someone assist?

Tres Seaver tseaver at palladion.com
Mon Sep 29 11:39:37 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dennis Allison wrote:
> We frequently use a design pattern which uses a multi-part form on a page.  
> The form is populated from a RDBMS.  Multiple submit buttons capture the
> function to be performed.  The form action routine breaks into a case-like
> if-elif-else statement.  Each action (e.g,, 'add', 'edit', 'delete') is
> implemented as a separate block of code. The form uses <POST> to transfer
> parameters (all strings or empty) to the action.  The action grabs the
> parameters, performs its function, and then continues in the application
> flow as needed, transferring control using a redirect to the desired URL
> with appended CGI parameter. Frequently the redirect simply return to the 
> original form for further modification. 
> 
> My problem:  In one form for one submit button, the redirect appears to
> fail.  The action is performed but the page to which the action redirects
> upon completion is never displayed.  Other actions from the same form work
> fine.  We have been trying to isolate the problem, but have not been
> successful--everything looks correct, but we still see the one failure.  
> Nearly identical code in other parts of the system works fine.
> 
> Any suggestions would be appreciated.  Is there somthing subtle and 
> unusual about the way Zope 2.11 manages redirects?  

Check that the response status is not "locked" by something which
happens before you call 'response.redirect'.  Also, you might pass
'lock=True' to that method, in case some other bit of code firing
*afterwards* is overwriting your redirect status.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI4Pa5+gerLs4ltQ4RAiPHAKCZ/sLEhrfrhsjanYeYjuLopn6uXQCgnHnv
J8+rWEYc9voOvkNtjqDhMaw=
=Ww7l
-----END PGP SIGNATURE-----



More information about the Zope mailing list