multitenant: inherit from TenantStorageMixin to avoid a warning (#18180)

This commit is contained in:
Frédéric Péters 2017-08-27 09:33:16 +02:00
parent 835fde9f78
commit a81cdb0280
1 changed files with 7 additions and 1 deletions

View File

@ -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: