Check image file size before the format

Checking the file format may take a long time if the uploaded file is
very big so it makes sense to check the file size first to prevent the
server being held up unneccessarily.
This commit is contained in:
Karl Hobley 2014-10-08 10:04:33 +01:00 committed by Karl Hobley
parent ffec059c12
commit 4a6a09ec13

View file

@ -76,7 +76,7 @@ class WagtailImageField(ImageField):
def to_python(self, data):
f = super(WagtailImageField, self).to_python(data)
self.check_image_file_format(f)
self.check_image_file_size(f)
self.check_image_file_format(f)
return f