Fix AttributeError in SizeFileField

This commit is contained in:
Raphael Michel
2020-05-25 15:44:46 +02:00
parent 1b85911a76
commit ca40ddc39b

View File

@@ -110,7 +110,7 @@ class SizeFileField(forms.FileField):
def clean(self, *args, **kwargs):
data = super().clean(*args, **kwargs)
if data and self.max_size and data.file.size > self.max_size:
if data and self.max_size and data.size > self.max_size:
raise forms.ValidationError(_("Please do not upload files larger than {size}!").format(
SizeFileField._sizeof_fmt(self.max_size)
))