1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #19215 -- Fixed rendering ClearableFileInput when editing with invalid files.

Thanks Michael Cardillo for the initial patch.
This commit is contained in:
Marcelo Galigniana
2022-10-16 23:02:56 -03:00
committed by Mariusz Felisiak
parent 64e5ef1f17
commit c0fc1b5302
4 changed files with 65 additions and 4 deletions

View File

@@ -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