Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12600 -- Added some extra search paths for comment preview tem…

…plates, allowing for naming parity with other templates in comments and admin. Thanks to hvdklauw for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12337 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3f68d255e24b5696537572ff351a8ad9f91d1b9d 1 parent 0cdd36f
Russell Keith-Magee authored January 28, 2010
8  django/contrib/comments/views/comments.py
@@ -78,8 +78,14 @@ def post_comment(request, next=None, using=None):
78 78
     # If there are errors or if we requested a preview show the comment
79 79
     if form.errors or preview:
80 80
         template_list = [
81  
-            "comments/%s_%s_preview.html" % tuple(str(model._meta).split(".")),
  81
+            # These first two exist for purely historical reasons.
  82
+            # Django v1.0 and v1.1 allowed the underscore format for
  83
+            # preview templates, so we have to preserve that format.
  84
+            "comments/%s_%s_preview.html" % (model._meta.app_label, model._meta.module_name),
82 85
             "comments/%s_preview.html" % model._meta.app_label,
  86
+            # Now the usual directory based template heirarchy.
  87
+            "comments/%s/%s/preview.html" % (model._meta.app_label, model._meta.module_name),
  88
+            "comments/%s/preview.html" % model._meta.app_label,
83 89
             "comments/preview.html",
84 90
         ]
85 91
         return render_to_response(

0 notes on commit 3f68d25

Please sign in to comment.
Something went wrong with that request. Please try again.