

def clean(self, *args, **kwargs):
    data = super().clean(*args, **kwargs)
    file = data.file
    if (file and hasattr(content_type, 'content_type')):
        content_type = file.content_type
        if (content_type in self.content_types):
            if (file._size > self.max_upload_size):
                raise forms.ValidationError(_('Please upload file up to {}. Your file size is {}.').format(filesizeformat(self.max_upload_size), filesizeformat(file._size)))
        else:
            raise forms.ValidationError(_('File type not supported.'))
    return data

dataset/ETHPy150Open jsmesami/naovoce/src/utils/fields.py ContentTypeRestrictedFileField.clean/VarMisuse@43/44 `file`->`content_type`