summaryrefslogtreecommitdiff
path: root/django/forms/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms/models.py')
-rw-r--r--django/forms/models.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index 0fba08855f..ac8bd1c860 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -376,6 +376,11 @@ class BaseModelForm(BaseForm):
exclude = self._get_validation_exclusions()
+ try:
+ self.instance = construct_instance(self, self.instance, opts.fields, exclude)
+ except ValidationError as e:
+ self._update_errors(e)
+
# Foreign Keys being used to represent inline relationships
# are excluded from basic field value validation. This is for two
# reasons: firstly, the value may not be supplied (#12507; the
@@ -388,11 +393,6 @@ class BaseModelForm(BaseForm):
exclude.append(name)
try:
- self.instance = construct_instance(self, self.instance, opts.fields, exclude)
- except ValidationError as e:
- self._update_errors(e)
-
- try:
self.instance.full_clean(exclude=exclude, validate_unique=False)
except ValidationError as e:
self._update_errors(e)