[Zope] Override a redirection in response

Dieter Maurer dieter@handshake.de
Sat, 23 Feb 2002 13:06:11 +0100


Pablo Ziliani writes:
 > I'm trying to "veneer" the ZMI's rename form.
 > Everything works util an error is rised (i.e. rename a file to an existing
 > file name); the manage_renameObject() method in CopySupport.py then
 > redirects to manage_main:
 > 
 > try:    ob._notifyOfCopyTo(self, op=1)
 > except: raise CopyError, MessageDialog(
 >         title='Invalid Id',
 >         message=sys.exc_info()[1],
 >         action ='manage_main') <- why isn't this
 >                                   conditioned? (i.e.)
 >                                   to the existence
 >                                   of a certain variable,
 >                                   as in
 > ...
 > Trying to catch the exception is in vain, the redirect remains.
 > So, is there anyway to catch this exception or at least to remove the
 > redirect from the RESPONSE?
There are redirections that cannot be reverted (they are locked).

But in the section "5.2 Programmatic Management" of

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

you can read that sometimes you may get rid of a redirection
by calling "RESPONSE.setStatus(200)".



Dieter