Loading django/forms/widgets.py +3 −1 Original line number Diff line number Diff line Loading @@ -331,6 +331,8 @@ class ClearableFileInput(FileInput): template_with_clear = '%(clear)s <label for="%(clear_checkbox_id)s">%(clear_checkbox_label)s</label>' url_markup_template = '<a href="{0}">{1}</a>' def clear_checkbox_name(self, name): """ Given the name of the file input, return the name of the clear checkbox Loading @@ -356,7 +358,7 @@ class ClearableFileInput(FileInput): if value and hasattr(value, "url"): template = self.template_with_initial substitutions['initial'] = format_html('<a href="{0}">{1}</a>', substitutions['initial'] = format_html(self.url_markup_template, value.url, force_text(value)) if not self.is_required: Loading Loading
django/forms/widgets.py +3 −1 Original line number Diff line number Diff line Loading @@ -331,6 +331,8 @@ class ClearableFileInput(FileInput): template_with_clear = '%(clear)s <label for="%(clear_checkbox_id)s">%(clear_checkbox_label)s</label>' url_markup_template = '<a href="{0}">{1}</a>' def clear_checkbox_name(self, name): """ Given the name of the file input, return the name of the clear checkbox Loading @@ -356,7 +358,7 @@ class ClearableFileInput(FileInput): if value and hasattr(value, "url"): template = self.template_with_initial substitutions['initial'] = format_html('<a href="{0}">{1}</a>', substitutions['initial'] = format_html(self.url_markup_template, value.url, force_text(value)) if not self.is_required: Loading