diff --git a/django/contrib/comments/views/comments.py b/django/contrib/comments/views/comments.py index cea3eefae0..6609103c60 100644 --- a/django/contrib/comments/views/comments.py +++ b/django/contrib/comments/views/comments.py @@ -78,8 +78,14 @@ def post_comment(request, next=None, using=None): # 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(".")), + # These first two exist for purely historical reasons. + # Django v1.0 and v1.1 allowed the underscore format for + # preview templates, so we have to preserve that format. + "comments/%s_%s_preview.html" % (model._meta.app_label, model._meta.module_name), "comments/%s_preview.html" % model._meta.app_label, + # Now the usual directory based template heirarchy. + "comments/%s/%s/preview.html" % (model._meta.app_label, model._meta.module_name), + "comments/%s/preview.html" % model._meta.app_label, "comments/preview.html", ] return render_to_response(