Currently, django.contrib.comments sends the user to the preview page if there is any error in the form.
I use comments in the context of the blog, and I would prefer the user to stay on the page they were on if something went wrong with the view. As far as I can tell, this is hardcoded in django.contrib.comments.views.comments.post_comment:
# If there are errors or if we requested a preview show the comment if form.errors or preview: template_list = [ "comments/%s_%s_preview.html" % tuple(str(model._meta).split(".")), "comments/%s_preview.html" % model._meta.app_label, "comments/preview.html", ] return render_to_response( template_list, { "comment" : form.data.get("comment", ""), "form" : form, "next": next, }, RequestContext(request, {}) )
Is there a way to change this behavior without changing the source code to django.contrib.comments?
Any pointer would be appreciated ...
Thanks!
python django django-contrib
Teebes
source share