Commits

Aron Griffis  committed 5396127

Don't bypass FileInput.render() so that value is appropriately omitted for <input type="file">

  • Participants
  • Parent commits 60d339e

Comments (0)

Files changed (2)

File form_utils/widgets.py

         super(ImageWidget, self).__init__(attrs)
 
     def render(self, name, value, attrs=None):
-        input_html = super(forms.FileInput, self).render(name, value, attrs)
+        input_html = super(ImageWidget, self).render(name, value, attrs)
         if hasattr(value, 'width') and hasattr(value, 'height'):
             image_html = thumbnail(value.name, self.width, self.height)
             output = self.template % {'input': input_html,

File tests/tests.py

         """
         widget = ImageWidget()
         html = widget.render('fieldname', FieldFile(None, FileField(), 'something.txt'))
-        self.assertHTMLEqual(html, '<input type="file" name="fieldname" value="something.txt" />')
+        self.assertHTMLEqual(html, '<input type="file" name="fieldname" />')
 
     def test_custom_template(self):
         """