Remove use of storage wrappers

Use a dynamic subclass instead that always deconstructs to a fake
subclass with a __eq__ method that always returns True. This should
trick makemigrations into never creating a new migrations for
changes to the storage class or the arguments.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-29 03:45:56 -04:00
parent 442bf5dc4b
commit 000fe87c37
11 changed files with 59 additions and 35 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from .managers import ErrorLogEntryManager, UserLocaleProfileManager
from .storages import storage_sharedupload_wrapper
from .storages import storage_sharedupload
logger = logging.getLogger(__name__)
@@ -58,7 +58,7 @@ class SharedUploadedFile(models.Model):
that runs out of process.
"""
file = models.FileField(
storage=storage_sharedupload_wrapper, upload_to=upload_to,
storage=storage_sharedupload, upload_to=upload_to,
verbose_name=_('File')
)
filename = models.CharField(max_length=255, verbose_name=_('Filename'))