From 5c7bbf1881e68718980840e818f645453abeb59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 1 Jan 2018 12:05:04 +0100 Subject: [PATCH 4/4] haystack: don't declare a file storage for fake initial tenant (#20933) --- hobo/multitenant/haystack.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hobo/multitenant/haystack.py b/hobo/multitenant/haystack.py index d084408..c1cb7f4 100644 --- a/hobo/multitenant/haystack.py +++ b/hobo/multitenant/haystack.py @@ -20,9 +20,21 @@ import os from django.conf import settings from django.db import connection + +from tenant_schemas.postgresql_backend.base import FakeTenant + import haystack.backends.whoosh_backend class WhooshSearchBackend(haystack.backends.whoosh_backend.WhooshSearchBackend): + @property + def use_file_storage(self): + tenant = connection.get_tenant() + return not(isinstance(connection.tenant, FakeTenant)) + + @use_file_storage.setter + def use_file_storage(self, value): + pass + @property def path(self): tenant = connection.get_tenant() -- 2.15.1