Author: jacob
Date: 2008-07-12 15:43:38 -0500 (Sat, 12 Jul 2008)
New Revision: 7907
Modified:
django/trunk/django/newforms/fields.py
Log:
Fixed #7673: make sure to rewind uploaded image data when validating
ImageFields. Thanks, Mike Axiak.
Modified: django/trunk/django/newforms/fields.py
===================================================================
--- django/trunk/django/newforms/fields.py 2008-07-12 20:43:28 UTC (rev
7906)
+++ django/trunk/django/newforms/fields.py 2008-07-12 20:43:38 UTC (rev
7907)
@@ -507,6 +507,8 @@
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(
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---