mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #31118 -- Made FileInput to avoid the required attribute when initial data exists.
This commit is contained in:
committed by
Mariusz Felisiak
parent
53d8646f79
commit
ffcf1a8ebf
@@ -387,6 +387,9 @@ class FileInput(Input):
|
||||
def value_omitted_from_data(self, data, files, name):
|
||||
return name not in files
|
||||
|
||||
def use_required_attribute(self, initial):
|
||||
return super().use_required_attribute(initial) and not initial
|
||||
|
||||
|
||||
FILE_INPUT_CONTRADICTION = object()
|
||||
|
||||
@@ -451,9 +454,6 @@ class ClearableFileInput(FileInput):
|
||||
return False
|
||||
return upload
|
||||
|
||||
def use_required_attribute(self, initial):
|
||||
return super().use_required_attribute(initial) and not initial
|
||||
|
||||
def value_omitted_from_data(self, data, files, name):
|
||||
return (
|
||||
super().value_omitted_from_data(data, files, name) and
|
||||
|
||||
Reference in New Issue
Block a user