Hello,
In using the comments framework, I have experienced some odd behaviour with regard to the "next" redirection. Provided that one specifies a value for "next" as part of the context for the template that contains the comment form, users posting valid comments without previewing them will indeed be redirected as expected. However, if the commenter previews his comment before posting, or if his comment contains errors, the "next" value is not honoured. If this is indeed a bug, it seems that it occurs in post_comment() in django.contrib.comments.views.comments. Following is the relevant code snippet: if form.errors or preview: ... return render_to_response( template_list, { "comment" : form.data.get("comment", ""), "form" : form, "next": next, }, RequestContext(request, {}) ) As you can see, the "next" value in the template's context is set to the variable next, which is set to a default value of None in the function's declaration. As a result, when the comment form is redisplayed for the user to preview or correct his comment, the form's "next" hidden element is not created. Since "next" is not included in the POST request made when the user submits his corrected or previewed comment, the default template of comments/posted.html is rendered, and the user is not redirected to the "next" value desired by the developer. Is this a bug that should be reported within the bug tracker, or should I attempt to work around the problem by subclassing CommentForm and adding fields to it? Thanks, Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---