Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8522 -- Allow app_index to take extra_context to be consistent…

… with the other views in the admin. Thanks Jannis Leidel for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8529 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit de977c851429974f90ba907332c1d8699b88b4da 1 parent 82a1d54
Brian Rosner authored August 25, 2008

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. 10  django/contrib/admin/sites.py
10  django/contrib/admin/sites.py
@@ -366,7 +366,7 @@ def display_login_form(self, request, error_message='', extra_context=None):
366 366
             context_instance=template.RequestContext(request)
367 367
         )
368 368
         
369  
-    def app_index(self, request, app_label):
  369
+    def app_index(self, request, app_label, extra_context=None):
370 370
         user = request.user
371 371
         has_module_perms = user.has_module_perms(app_label)
372 372
         app_dict = {}
@@ -399,10 +399,14 @@ def app_index(self, request, app_label):
399 399
                         raise http.Http404('The requested admin page does not exist.')
400 400
         # Sort the models alphabetically within each app.
401 401
         app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
402  
-        return render_to_response(self.app_index_template or 'admin/app_index.html', {
  402
+        context = {
403 403
             'title': _('%s administration' % capfirst(app_label)),
404 404
             'app_list': [app_dict]
405  
-        }, context_instance=template.RequestContext(request))
  405
+        }
  406
+        context.update(extra_context or {})
  407
+        return render_to_response(self.app_index_template or 'admin/app_index.html', context,
  408
+            context_instance=template.RequestContext(request)
  409
+        )
406 410
 
407 411
 # This global object represents the default admin site, for the common case.
408 412
 # You can instantiate AdminSite in your own code to create a custom admin site.

0 notes on commit de977c8

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