Ticket #22199: filefield-deconstruct-max-length.patch

File filefield-deconstruct-max-length.patch, 626 bytes (added by Julian Brost, 11 years ago)
  • django/db/models/fields/files.py

    diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
    index 9d4a06d..0b2a24a 100644
    a b class FileField(Field):  
    270270
    271271    def deconstruct(self):
    272272        name, path, args, kwargs = super(FileField, self).deconstruct()
    273         if kwargs.get("max_length", None) != 100:
    274             kwargs["max_length"] = 100
    275         else:
     273        if kwargs.get("max_length", None) == 100:
    276274            del kwargs["max_length"]
    277275        kwargs['upload_to'] = self.upload_to
    278276        if self.storage is not default_storage:
Back to Top