#12749: "Please correct the error below." when saving add model form with inline
formset and no auto primary key.
---------------------------------------------+------------------------------
          Reporter:  [email protected]  |         Owner:  jkocherhans
            Status:  assigned                |     Milestone:  1.2        
         Component:  django.contrib.admin    |       Version:  SVN        
        Resolution:                          |      Keywords:             
             Stage:  Accepted                |     Has_patch:  1          
        Needs_docs:  0                       |   Needs_tests:  0          
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by jkocherhans):

  * owner:  nobody => jkocherhans
  * status:  new => assigned

Comment:

 I'm not quite sure how to fix this yet, but the fix should probably be in
 `ForeignKey.validate()`. Generally, when we're adding inline objects, the
 value of the FK to the parent object will be `None` since the parent
 hasn't been saved yet. If the value is `None`, the `ForeignKey` validation
 is skipped. However, in this case, the `ForeignKey` has a value of 1 since
 the Person object has already been saved. Person isn't the *real* parent
 object, but the real parent's primary key is a `ForeignKey` to Person.

 [12206] just rolled back part of model validation, but it was the part of
 model validation that allowed cases like this to pass. Reverting that
 isn't an option.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12749#comment:8>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to