diff options
| author | Marcelo Galigniana <marcelogaligniana@gmail.com> | 2022-10-16 23:02:56 -0300 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-10-25 16:53:52 +0200 |
| commit | c0fc1b5302f5d9d82e2255fb5758321fbac34949 (patch) | |
| tree | d1f3990e58c227fb5338e4ce613a2dd50e459fd8 /django/forms | |
| parent | 64e5ef1f17cd18cb8ca24f4e7107dfd28c18b378 (diff) | |
Fixed #19215 -- Fixed rendering ClearableFileInput when editing with invalid files.
Thanks Michael Cardillo for the initial patch.
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/fields.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 8fa7b72cfd..46de2f53a0 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -677,10 +677,8 @@ class FileField(Field): return initial return super().clean(data) - def bound_data(self, data, initial): - if data in (None, FILE_INPUT_CONTRADICTION): - return initial - return data + def bound_data(self, _, initial): + return initial def has_changed(self, initial, data): return not self.disabled and data is not None |
