Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #187 -- Made admin view handle one-to-one relationships in whic…

…h the parent relationship doesn't have the 'admin' parameter set. Thanks, Moof

git-svn-id: http://code.djangoproject.com/svn/django/trunk@331 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9b983831752d61b340bc67b0be5d2c8c5dbfcb18 1 parent d52db2d
Adrian Holovaty authored July 26, 2005

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

  1. 3  django/views/admin/main.py
3  django/views/admin/main.py
@@ -79,6 +79,9 @@ def change_list(request, app_label, module_name):
79 79
     if opts.one_to_one_field:
80 80
         lookup_mod = opts.one_to_one_field.rel.to.get_model_module()
81 81
         lookup_opts = lookup_mod.Klass._meta
  82
+        # If lookup_opts doesn't have admin set, give it the default meta.Admin().
  83
+        if not lookup_opts.admin:
  84
+            lookup_opts.admin = meta.Admin()
82 85
 
83 86
     # Get search parameters from the query string.
84 87
     try:

0 notes on commit 9b98383

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