mirror of
https://github.com/django/django.git
synced 2025-07-19 03:05:32 +00:00
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:
parent
6ce25d3be9
commit
fea6c73538
5 changed files with 28 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue