diff options
| author | Alex Hill <alex@hill.net.au> | 2016-09-01 13:18:41 +0800 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-01 09:13:21 -0400 |
| commit | d9c083cfee853272ded14c6c87623e910c9e81c4 (patch) | |
| tree | 96e7b2aa221b088f829bb1238185921bb88af29c /django/forms | |
| parent | ca2ccf54ffa95cf001260b917dd267fda60e93d5 (diff) | |
Refs #27039 -- Fixed regression with field defaults in prefixed forms.
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 628d96b237..ff6b2f0251 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -54,7 +54,7 @@ def construct_instance(form, instance, fields=None, exclude=None): continue # Leave defaults for fields that aren't in POST data, except for # checkbox inputs because they don't appear in POST data if not checked. - if (f.has_default() and f.name not in form.data and + if (f.has_default() and form.add_prefix(f.name) not in form.data and not getattr(form[f.name].field.widget, 'dont_use_model_field_default_for_empty_data', False)): continue # Defer saving file-type fields until after the other fields, so a |
