Skip to content

Commit

Permalink
Fixed #12600 -- Added some extra search paths for comment preview tem…
Browse files Browse the repository at this point in the history
…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
freakboy3742 committed Jan 28, 2010
1 parent 0cdd36f commit 3f68d25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion django/contrib/comments/views/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3f68d25

Please sign in to comment.