summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2010-02-23 20:02:18 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2010-02-23 20:02:18 +0000
commit6ba5fb37287ab88e2039d754e89788bb864ee123 (patch)
tree019813f61882990c86c82473fe654b1b1593cb93 /django
parentc05de31d75970e3d5ea9ecec37e332a0f01c0fbb (diff)
Fixed #12420. Now that OneToOneField allows assignment of None, stop guarding against it in ModelForms. Thanks, andrewsk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/forms/models.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index 430dd4d7cc..96e2008e3f 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -48,10 +48,6 @@ def construct_instance(form, instance, fields=None, exclude=None):
continue
if exclude and f.name in exclude:
continue
- # OneToOneField doesn't allow assignment of None. Guard against that
- # instead of allowing it and throwing an error.
- if isinstance(f, models.OneToOneField) and cleaned_data[f.name] is None:
- continue
# Defer saving file-type fields until after the other fields, so a
# callable upload_to can use the values from other fields.
if isinstance(f, models.FileField):