Redirect to the comment form action instead of the absolute url when a comment is posted. This fixes the accidentially triggered file upload when a comment is posted on a file content object.
svn path=/plone.app.discussion/trunk/; revision=38664
This commit is contained in:
parent
7fef29cf64
commit
d37d5aa9f5
@ -4,6 +4,11 @@ Changelog
|
|||||||
1.0b6 (unreleased)
|
1.0b6 (unreleased)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
* Redirect to the comment form action instead of the absolute url when a
|
||||||
|
comment is posted. This fixes the accidentially triggered file upload when a
|
||||||
|
comment is posted on a file content object.
|
||||||
|
[timo]
|
||||||
|
|
||||||
* We need five:registerPackage to register the i18n folder.
|
* We need five:registerPackage to register the i18n folder.
|
||||||
[vincentfretin]
|
[vincentfretin]
|
||||||
|
|
||||||
|
@ -182,10 +182,10 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
|
|||||||
IStatusMessage(self.context.REQUEST).addStatusMessage(
|
IStatusMessage(self.context.REQUEST).addStatusMessage(
|
||||||
_("Your comment awaits moderator approval."),
|
_("Your comment awaits moderator approval."),
|
||||||
type="info")
|
type="info")
|
||||||
self.request.response.redirect(context.absolute_url())
|
self.request.response.redirect(self.action)
|
||||||
else:
|
else:
|
||||||
# Redirect to comment (inside a content object page)
|
# Redirect to comment (inside a content object page)
|
||||||
self.request.response.redirect(context.absolute_url() + '#' + str(comment_id))
|
self.request.response.redirect(self.action + '#' + str(comment_id))
|
||||||
|
|
||||||
@button.buttonAndHandler(_(u"Cancel"))
|
@button.buttonAndHandler(_(u"Cancel"))
|
||||||
def handleCancel(self, action):
|
def handleCancel(self, action):
|
||||||
|
Loading…
Reference in New Issue
Block a user