summaryrefslogtreecommitdiff
path: root/django/newforms/fields.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/newforms/fields.py')
-rw-r--r--django/newforms/fields.py2
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(