Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #7673: make sure to rewind uploaded image data when validating …

…ImageFields. Thanks, Mike Axiak.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7907 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e63f8bf65571d07c02725a4c86036be11e949916 1 parent 5f73e2c
Jacob Kaplan-Moss authored July 12, 2008

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  django/newforms/fields.py
2  django/newforms/fields.py
@@ -507,6 +507,8 @@ def clean(self, data, initial=None):
507 507
             trial_image.verify()
508 508
         except Exception: # Python Imaging Library doesn't recognize it as an image
509 509
             raise ValidationError(self.error_messages['invalid_image'])
  510
+        if hasattr(f, 'seek') and callable(f.seek):
  511
+            f.seek(0)
510 512
         return f
511 513
 
512 514
 url_re = re.compile(

0 notes on commit e63f8bf

Please sign in to comment.
Something went wrong with that request. Please try again.