diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-07-12 20:43:38 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-07-12 20:43:38 +0000 |
| commit | e63f8bf65571d07c02725a4c86036be11e949916 (patch) | |
| tree | b6398a52e012b144af1610ffd0764ba9f685e76b | |
| parent | 5f73e2c4fa5f40f528d4d1d6999697e7f3f5248f (diff) | |
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
| -rw-r--r-- | django/newforms/fields.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/newforms/fields.py b/django/newforms/fields.py index ad46d78859..bfff9fe8b0 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -507,6 +507,8 @@ class ImageField(FileField): trial_image.verify() 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( |
