diff --git a/django/forms/models.py b/django/forms/models.py
index f343a1c..b636105 100644
|
a
|
b
|
def construct_instance(form, instance, fields=None, exclude=None):
|
| 50 | 50 | continue |
| 51 | 51 | # OneToOneField doesn't allow assignment of None. Guard against that |
| 52 | 52 | # instead of allowing it and throwing an error. |
| 53 | | if isinstance(f, models.OneToOneField) and cleaned_data[f.name] is None: |
| | 53 | if isinstance(f, models.OneToOneField) and f.null == False and cleaned_data[f.name] is None: |
| 54 | 54 | continue |
| 55 | 55 | # Defer saving file-type fields until after the other fields, so a |
| 56 | 56 | # callable upload_to can use the values from other fields. |