1. Luke Plant
  2. django


ja...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 15a2caa

Fixed #7673: make sure to rewind uploaded image data when validating ImageFields. Thanks, Mike Axiak.

  • Participants
  • Parent commits e272799
  • Branches default

Comments (0)

Files changed (1)

File django/newforms/fields.py

View file
         except Exception: # Python Imaging Library doesn't recognize it as an image
             raise ValidationError(self.error_messages['invalid_image'])
+        if hasattr(f, 'seek') and callable(f.seek):
+            f.seek(0)
         return f
 url_re = re.compile(