From c9848bebfeed51263e4afc5e16d007fa441f5f3f Mon Sep 17 00:00:00 2001 From: Huub Bouma Date: Thu, 12 Apr 2012 13:06:05 +0200 Subject: [PATCH] no more recursive came_from redirection after logged_in --- plone/app/discussion/browser/moderation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/browser/moderation.py b/plone/app/discussion/browser/moderation.py index 4e44a9b..c0e0985 100644 --- a/plone/app/discussion/browser/moderation.py +++ b/plone/app/discussion/browser/moderation.py @@ -99,7 +99,8 @@ class DeleteComment(BrowserView): _("Comment deleted."), type="info") came_from = self.context.REQUEST.HTTP_REFERER - if len(came_from) == 0: + # if the referrer already has a came_from in it, don't redirect back + if len(came_from) == 0 or 'came_from=' in came_from: came_from = content_object.absolute_url() return self.context.REQUEST.RESPONSE.redirect(came_from) @@ -138,7 +139,8 @@ class PublishComment(BrowserView): _("Comment approved."), type="info") came_from = self.context.REQUEST.HTTP_REFERER - if len(came_from) == 0: + # if the referrer already has a came_from in it, don't redirect back + if len(came_from) == 0 or 'came_from=' in came_from: came_from = content_object.absolute_url() return self.context.REQUEST.RESPONSE.redirect(came_from)