diff options
| author | Carl Meyer <carl@oddbird.net> | 2010-11-18 23:29:58 +0000 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2010-11-18 23:29:58 +0000 |
| commit | 008f333bac7ceada4aca06b274a57ede1f8bc3d9 (patch) | |
| tree | b483fa90ab418cd0592d9f0ba2d5b6470af1e854 /django/forms | |
| parent | 38ba3775ec86718fabdf0ba1d5baf04a0f2164a7 (diff) | |
Fixed pk uniqueness validation for new objects created outside of a ModelForm. Also removed need for ModelForm to poke at Model._state.adding, keeping it an internal ORM concern.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14613 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/models.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 729f523103..4ffc3b6fac 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -254,10 +254,8 @@ class BaseModelForm(BaseForm): # if we didn't get an instance, instantiate a new one self.instance = opts.model() object_data = {} - self.instance._state.adding = True else: self.instance = instance - self.instance._state.adding = False object_data = model_to_dict(instance, opts.fields, opts.exclude) # if initial was provided, it should override the values from instance if initial is not None: |
