mirror of
https://github.com/django/django.git
synced 2025-07-18 18:55:18 +00:00
Fixed #22199: Bad max_length deconstruction for FileField
This commit is contained in:
parent
28779abb75
commit
cd7a2a077e
2 changed files with 16 additions and 7 deletions
|
@ -270,9 +270,7 @@ class FileField(Field):
|
|||
|
||||
def deconstruct(self):
|
||||
name, path, args, kwargs = super(FileField, self).deconstruct()
|
||||
if kwargs.get("max_length", None) != 100:
|
||||
kwargs["max_length"] = 100
|
||||
else:
|
||||
if kwargs.get("max_length", None) == 100:
|
||||
del kwargs["max_length"]
|
||||
kwargs['upload_to'] = self.upload_to
|
||||
if self.storage is not default_storage:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue