summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/widgets.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 338d54d72f..40ac1d3162 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -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