Skip to content

Commit

Permalink
Revert part of c424137, closes #115.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 6, 2017
1 parent 7edc515 commit f178768
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/App/ApplicationManager.py
Expand Up @@ -18,7 +18,6 @@
from AccessControl.requestmethod import requestmethod
from Acquisition import Implicit
from six.moves.urllib import parse
from zExceptions import Redirect

from App.config import getConfiguration
from App.Management import Tabs
Expand Down Expand Up @@ -180,6 +179,7 @@ def manage_minimize(self, value=1, REQUEST=None):
self._getDB().cacheMinimize()

if REQUEST is not None:
raise Redirect(REQUEST['URL1'] + '/manage_main')
REQUEST.RESPONSE.redirect(REQUEST['URL1'] + '/manage_main')


InitializeClass(AltDatabaseManager)
4 changes: 2 additions & 2 deletions src/App/Undo.py
Expand Up @@ -21,7 +21,6 @@
from AccessControl.Permissions import undo_changes
from DateTime.DateTime import DateTime
import transaction
from zExceptions import Redirect

from App.Management import Tabs
from App.special_dtml import DTMLFile
Expand Down Expand Up @@ -116,7 +115,8 @@ def manage_undo_transactions(self, transaction_info=(), REQUEST=None):
self._p_jar.db().undoMultiple(tids)

if REQUEST is not None:
raise Redirect('%s/manage_UndoForm' % REQUEST['URL1'])
REQUEST.RESPONSE.redirect("%s/manage_UndoForm" % REQUEST['URL1'])


InitializeClass(UndoSupport)

Expand Down
3 changes: 1 addition & 2 deletions src/OFS/DTMLDocument.py
Expand Up @@ -18,7 +18,6 @@
from DocumentTemplate.permissions import change_dtml_methods
from DocumentTemplate.permissions import change_dtml_documents
from six.moves.urllib.parse import quote
from zExceptions import Redirect
from zExceptions import ResourceLockedError
from zExceptions.TracebackSupplement import PathTracebackSupplement
from zope.contenttype import guess_content_type
Expand Down Expand Up @@ -164,5 +163,5 @@ def addDTMLDocument(self, id, title='', file='', REQUEST=None, submit=None):
u = REQUEST['URL1']
if submit == " Add and Edit ":
u = "%s/%s" % (u, quote(id))
raise Redirect(u + '/manage_main')
REQUEST.RESPONSE.redirect(u + '/manage_main')
return ''
3 changes: 1 addition & 2 deletions src/OFS/DTMLMethod.py
Expand Up @@ -29,7 +29,6 @@
from DocumentTemplate.security import RestrictedDTML
from six.moves.urllib.parse import quote
from zExceptions import Forbidden
from zExceptions import Redirect
from zExceptions import ResourceLockedError
from zExceptions.TracebackSupplement import PathTracebackSupplement
from zope.contenttype import guess_content_type
Expand Down Expand Up @@ -425,5 +424,5 @@ def addDTMLMethod(self, id, title='', file='', REQUEST=None, submit=None):
u = REQUEST['URL1']
if submit == " Add and Edit ":
u = "%s/%s" % (u, quote(id))
raise Redirect(u + '/manage_main')
REQUEST.RESPONSE.redirect(u + '/manage_main')
return ''
4 changes: 2 additions & 2 deletions src/OFS/Image.py
Expand Up @@ -83,7 +83,7 @@ def manage_addFile(self, id, file='', title='', precondition='',
notify(ObjectCreatedEvent(newFile))

if REQUEST is not None:
raise Redirect(self.absolute_url() + '/manage_main')
REQUEST.RESPONSE.redirect(self.absolute_url() + '/manage_main')


@implementer(IWriteLock,
Expand Down Expand Up @@ -699,7 +699,7 @@ def manage_addImage(self, id, file, title='', precondition='', content_type='',
url = self.DestinationURL()
except Exception:
url = REQUEST['URL1']
raise Redirect('%s/manage_main' % url)
REQUEST.RESPONSE.redirect('%s/manage_main' % url)
return id


Expand Down
2 changes: 1 addition & 1 deletion src/OFS/PropertySheets.py
Expand Up @@ -61,7 +61,7 @@ class View(Tabs, Base):
def manage_workspace(self, URL1, RESPONSE):
'''Implement a "management" interface
'''
raise Redirect(URL1 + '/manage')
RESPONSE.redirect(URL1 + '/manage')

def tpURL(self):
return self.getId()
Expand Down
6 changes: 3 additions & 3 deletions src/OFS/owner.py
Expand Up @@ -26,7 +26,6 @@
from Acquisition import aq_get
from Acquisition import aq_parent
from six.moves.urllib import parse
from zExceptions import Redirect

from App.special_dtml import DTMLFile

Expand Down Expand Up @@ -62,7 +61,8 @@ def manage_takeOwnership(self, REQUEST, RESPONSE, recursive=0):

self.changeOwnership(security.getUser(), recursive)

raise Redirect(REQUEST['HTTP_REFERER'])
if RESPONSE is not None:
RESPONSE.redirect(REQUEST['HTTP_REFERER'])

security.declareProtected(take_ownership, 'manage_changeOwnershipType')
@requestmethod('POST')
Expand All @@ -86,6 +86,6 @@ def manage_changeOwnershipType(self, explicit=1,
del self._owner

if RESPONSE is not None:
raise Redirect(REQUEST['HTTP_REFERER'])
RESPONSE.redirect(REQUEST['HTTP_REFERER'])

InitializeClass(Owned)
3 changes: 1 addition & 2 deletions src/OFS/userfolder.py
Expand Up @@ -27,7 +27,6 @@
from AccessControl.users import reqattr
from Acquisition import aq_base
from zExceptions import BadRequest
from zExceptions import Redirect

from App.Management import Navigation
from App.Management import Tabs
Expand Down Expand Up @@ -306,4 +305,4 @@ def manage_addUserFolder(self, dtself=None, REQUEST=None, **ignored):
raise BadRequest('This object already contains a User Folder')
self.__allow_groups__ = f
if REQUEST is not None:
raise Redirect(self.absolute_url() + '/manage_main')
REQUEST.RESPONSE.redirect(self.absolute_url() + '/manage_main')
6 changes: 3 additions & 3 deletions src/Products/Five/browser/adding.py
Expand Up @@ -22,7 +22,6 @@
import operator

from zExceptions import BadRequest
from zExceptions import Redirect
from zope.browser.interfaces import IAdding
from zope.browsermenu.menu import getMenu
from zope.component import getMultiAdapter
Expand Down Expand Up @@ -136,7 +135,8 @@ def action(self, type_name='', id=''):
name=view_name) is not None:
url = "%s/%s=%s" % (
absoluteURL(self, self.request), type_name, id)
raise Redirect(url)
self.request.response.redirect(url)
return

if not self.contentName:
self.contentName = id
Expand All @@ -147,7 +147,7 @@ def action(self, type_name='', id=''):
notify(ObjectCreatedEvent(content))

self.add(content)
raise Redirect(self.nextURL())
self.request.response.redirect(self.nextURL())

def nameAllowed(self):
"""Return whether names can be input by the user."""
Expand Down
5 changes: 2 additions & 3 deletions src/Products/PageTemplates/ZopePageTemplate.py
Expand Up @@ -26,7 +26,6 @@
from Acquisition import Acquired
from Acquisition import aq_get
from Acquisition import Explicit
from zExceptions import Redirect
from zExceptions import ResourceLockedError

from App.Common import package_home
Expand Down Expand Up @@ -428,9 +427,9 @@ def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8',

if RESPONSE:
if submit == " Add and Edit ":
raise Redirect(zpt.absolute_url() + '/pt_editForm')
RESPONSE.redirect(zpt.absolute_url() + '/pt_editForm')
else:
raise Redirect(self.absolute_url() + '/manage_main')
RESPONSE.redirect(self.absolute_url() + '/manage_main')
else:
return zpt

Expand Down

0 comments on commit f178768

Please sign in to comment.