Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.1.X] Moved _get_foreign_key call after testing for fk_name fixing …

…a broken test.

Backport of [11643] from trunk.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b06d1be7644a6c6a48745bea193d5649e67bc3b4 1 parent aaa9ccf
@brosner brosner authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/contrib/admin/
5 django/contrib/admin/
@@ -150,14 +150,15 @@ def validate(cls, model):
def validate_inline(cls, parent, parent_model):
- fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)
# model is already verified to exist and be a Model
if cls.fk_name: # default value is None
f = get_field(cls, cls.model, cls.model._meta, 'fk_name', cls.fk_name)
if not isinstance(f, models.ForeignKey):
raise ImproperlyConfigured("'%s.fk_name is not an instance of "
"models.ForeignKey." % cls.__name__)
+ fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)
# extra = 3
# max_num = 0
for attr in ('extra', 'max_num'):
Please sign in to comment.
Something went wrong with that request. Please try again.