Author: russellm Date: 2010-01-28 05:30:29 -0600 (Thu, 28 Jan 2010) New Revision: 12337
Modified: django/trunk/django/contrib/comments/views/comments.py Log: Fixed #12600 -- Added some extra search paths for comment preview templates, allowing for naming parity with other templates in comments and admin. Thanks to hvdklauw for the report. Modified: django/trunk/django/contrib/comments/views/comments.py =================================================================== --- django/trunk/django/contrib/comments/views/comments.py 2010-01-28 05:55:44 UTC (rev 12336) +++ django/trunk/django/contrib/comments/views/comments.py 2010-01-28 11:30:29 UTC (rev 12337) @@ -78,8 +78,14 @@ # 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( -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.