This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django import forms | |
| from django.template.defaultfilters import filesizeformat | |
| from django.utils.translation import ugettext_lazy as _ | |
| from django.conf import settings | |
| class RestrictedFileField(forms.FileField): | |
| def __init__(self, *args, **kwargs): | |
| self.content_types = kwargs.pop('content_types', None) | |
| self.max_upload_size = kwargs.pop('max_upload_size', None) | |
| if not self.max_upload_size: |