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:
committed by
Mariusz Felisiak
parent
64e5ef1f17
commit
c0fc1b5302
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user