Fixed #10149. FileFields in a form now validate max_length. Based on a patch by Massimo Scamarcia.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2009-03-30 22:52:16 +00:00
parent 6ce25d3be9
commit fea6c73538
5 changed files with 28 additions and 2 deletions

View file

@ -222,7 +222,7 @@ class FileField(Field):
setattr(instance, self.name, data)
def formfield(self, **kwargs):
defaults = {'form_class': forms.FileField}
defaults = {'form_class': forms.FileField, 'max_length': self.max_length}
# If a file has been provided previously, then the form doesn't require
# that a new file is provided this time.
# The code to mark the form field as not required is used by