Commit 74d19e9b authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #572 from piranha/patch-2

upload.py: more fixes for py3
parents e0b51192 2dbd8495
...@@ -356,7 +356,9 @@ class ImageUploadField(FileUploadField): ...@@ -356,7 +356,9 @@ class ImageUploadField(FileUploadField):
def pre_validate(self, form): def pre_validate(self, form):
super(ImageUploadField, self).pre_validate(form) super(ImageUploadField, self).pre_validate(form)
if self.data and isinstance(self.data, FileStorage): if (self.data and
isinstance(self.data, FileStorage) and
self.data.filename):
try: try:
self.image = Image.open(self.data) self.image = Image.open(self.data)
except Exception as e: except Exception as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment