Skip to content
Browse files

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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent d52db2d commit 9b983831752d61b340bc67b0be5d2c8c5dbfcb18 @adrianholovaty adrianholovaty committed
Showing with 3 additions and 0 deletions.
  1. +3 −0 django/views/admin/
3 django/views/admin/
@@ -79,6 +79,9 @@ def change_list(request, app_label, module_name):
if opts.one_to_one_field:
lookup_mod =
lookup_opts = lookup_mod.Klass._meta
+ # If lookup_opts doesn't have admin set, give it the default meta.Admin().
+ if not lookup_opts.admin:
+ lookup_opts.admin = meta.Admin()
# Get search parameters from the query string.

0 comments on commit 9b98383

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