Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11644 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b06d1be7644a6c6a48745bea193d5649e67bc3b4 1 parent aaa9ccf
Brian Rosner authored October 23, 2009

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

  1. 5  django/contrib/admin/validation.py
5  django/contrib/admin/validation.py
@@ -150,14 +150,15 @@ def validate(cls, model):
150 150
 
151 151
 def validate_inline(cls, parent, parent_model):
152 152
     
153  
-    fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)
154  
-    
155 153
     # model is already verified to exist and be a Model
156 154
     if cls.fk_name: # default value is None
157 155
         f = get_field(cls, cls.model, cls.model._meta, 'fk_name', cls.fk_name)
158 156
         if not isinstance(f, models.ForeignKey):
159 157
             raise ImproperlyConfigured("'%s.fk_name is not an instance of "
160 158
                     "models.ForeignKey." % cls.__name__)
  159
+
  160
+    fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)
  161
+
161 162
     # extra = 3
162 163
     # max_num = 0
163 164
     for attr in ('extra', 'max_num'):

0 notes on commit b06d1be

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