diff options
| author | Syed Waheed <105697767+Waheedsys@users.noreply.github.com> | 2024-01-23 14:17:31 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 09:47:31 +0100 |
| commit | d9b91e38361696014bdc98434d6d018eae809519 (patch) | |
| tree | 1d28c506d4a9edf99352a774f46b1440b260a752 /django/forms/forms.py | |
| parent | bbfbf0ab686030f8da5ea22a65c41b9574681262 (diff) | |
Fixed #32923 -- Refactored out Field._clean_bound_field().
Diffstat (limited to 'django/forms/forms.py')
| -rw-r--r-- | django/forms/forms.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/django/forms/forms.py b/django/forms/forms.py index 5de14d598a..452f554e1e 100644 --- a/django/forms/forms.py +++ b/django/forms/forms.py @@ -6,7 +6,7 @@ import copy import datetime from django.core.exceptions import NON_FIELD_ERRORS, ValidationError -from django.forms.fields import Field, FileField +from django.forms.fields import Field from django.forms.utils import ErrorDict, ErrorList, RenderableFormMixin from django.forms.widgets import Media, MediaDefiningClass from django.utils.datastructures import MultiValueDict @@ -329,13 +329,8 @@ class BaseForm(RenderableFormMixin): def _clean_fields(self): for name, bf in self._bound_items(): field = bf.field - value = bf.initial if field.disabled else bf.data try: - if isinstance(field, FileField): - value = field.clean(value, bf.initial) - else: - value = field.clean(value) - self.cleaned_data[name] = value + self.cleaned_data[name] = field._clean_bound_field(bf) if hasattr(self, "clean_%s" % name): value = getattr(self, "clean_%s" % name)() self.cleaned_data[name] = value |
