Commit 2dbd8495 authored by Alexander Solovyov's avatar Alexander Solovyov

upload.py: more fixes for py3

parent e0b51192
......@@ -356,7 +356,9 @@ class ImageUploadField(FileUploadField):
def pre_validate(self, 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:
self.image = Image.open(self.data)
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