Skip to content

Commit 70e03c4

Browse files
author
Jesús Espino
committed
Fixing issue #5: Thanks to @alan-martinovic
1 parent 05b8db1 commit 70e03c4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

validatedfile/fields.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,19 @@ def __call__(self, file):
8787
_('Please keep the total uploaded files under %(total_size)s. With this file, the total would be %(exceed_size)s.' %
8888
{'total_size': filesizeformat(self.quota.max_usage), 'exceed_size': filesizeformat(self.quota.current_usage + file_size)})
8989
)
90+
91+
try:
92+
from south.modelsinspector import add_introspection_rules
93+
add_introspection_rules([
94+
(
95+
[ValidatedFileField],
96+
[],
97+
{
98+
"content_types": ["content_types", {"default": []}],
99+
"max_upload_size": ["max_upload_size", {"default": 0}],
100+
"mime_lookup_length": ["mime_lookup_length", {"default": 4096}],
101+
},
102+
),
103+
], ["^validatedfile\.fields\.ValidatedFileField"])
104+
except ImportError:
105+
pass

0 commit comments

Comments
 (0)