multitenant: inherit from TenantStorageMixin to avoid a warning (#18180)
This commit is contained in:
parent
835fde9f78
commit
a81cdb0280
|
@ -8,9 +8,15 @@ from django.db import connection
|
|||
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
|
||||
try:
|
||||
from tenant_schemas.storage import TenantStorageMixin
|
||||
except ImportError:
|
||||
class TenantStorageMixin:
|
||||
pass
|
||||
|
||||
__all__ = ('TenantFileSystemStorage', )
|
||||
|
||||
class TenantFileSystemStorage(FileSystemStorage):
|
||||
class TenantFileSystemStorage(FileSystemStorage, TenantStorageMixin):
|
||||
'''Lookup files first in $TENANT_BASE/<tenant.schema>/media/ then in default location'''
|
||||
def path(self, name):
|
||||
if connection.tenant:
|
||||
|
|
Loading…
Reference in New Issue