I'm building the submission form using {% get_comment_form for object as
form %} and have added the following as part of the form
<input type="hidden" name="next" value="{{ object.get_absolute_url }}" />
As I understand it, that should force comments to redirect to that URL
after successful submission - the problem is it doesn't.
If I view the source of the submission form, the tag is there and
populated correctly - if I preview or submit an incorrect POST then it
brings up the preview screen, but there isn't a hidden next field in
there.
If I submit a correctly formed comment, it brings up the "Thank you for
your comment" template but doesn't redirect back to the original object.
I've tried removing the hidden field and doing
<form action="{% comment_form_target %}?next={{ object.get_absolute_url
}}" method="POST">
and have the same problem - is this a known problem, or is it developer
error (me)?
Many thanks
Kevin
<snip>
>
> It's a known problem and the patch for this is already in trunk –
> update to r10418 or later, or you can stick the patch in yourself
> (it's a pretty clean one-liner).
>
> HTH,
> Eric
>
Thanks Eric, I'm running r10858 and having this problem - I've removed any
comments templates I've overridden in my application and still getting the
same problem - when the next parameter is passed in, it gets ignored :(
Many thanks
Kevin
Looking at the django source the next parameter is included in the default
preview template -
http://code.djangoproject.com/browser/django/trunk/django/contrib/comments/templates/comments/preview.html
line 9
The code I'm using to submit the comment looks similar to
{% get_comment_form for object as form %}
<form action="{% comment_form_target
%}?next=http://blog.kenwa-solutions.co.uk/" method="POST">
<input type="hidden" name="next" value="{{ object.get_absolute_url }}" />
<snip />
So I'm not sure why the default preview form isn't picking it up
Many thanks
Kevin
I think that http://code.djangoproject.com/ticket/8968 has something to
do with your problem.
--
Happy Hacking.