﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18697	django.contrib.admin.AdminSite should not pass a sequence as the template to TemplateResponse	and@…	nobody	"This appears to be a simple coding error.

I have code (mobile-admin) that sets index_template to ['admin/index.html', 'index.html'].  The current call ends up passing [['admin/index.html', 'index.html']] to TemplateResponse, which fails with a TypeError trying to use ['admin/index.html', 'index.html'] as a template.

The following patch fixes this issue:

{{{
root@host:/usr/share/pyshared/django/contrib/admin# diff -uw sites.py{.orig,}
--- sites.py.orig	2012-03-23 12:59:19.000000000 -0400
+++ sites.py	2012-08-01 18:18:55.000000000 -0400
@@ -381,9 +381,9 @@
             'app_list': app_list,
         }
         context.update(extra_context or {})
-        return TemplateResponse(request, [
+        return TemplateResponse(request,
             self.index_template or 'admin/index.html',
-        ], context, current_app=self.name)
+            context, current_app=self.name)
 
     def app_index(self, request, app_label, extra_context=None):
         user = request.user
}}}"	Bug	new	contrib.admin	1.4	Normal				Unreviewed	0	0	0	0	0	0
