Commits

Simone Marzola committed 9d80a09

fixed thumbnail creation when the uploaded file is a cStringIO.StringO object

Comments (0)

Files changed (1)

tgext/datahelpers/fields.py

     def write(self):
         super(AttachedImage, self).write()
 
-        if self.file.name != self.local_path:
+        if getattr(self.file, 'name', None) != self.local_path:
             self.file.seek(0)
             thumbnail = Image.open(self.file)
             thumbnail.thumbnail(self.thumbnail_size, Image.BILINEAR)