From be5b443d01e3dee1cde06b02abfb571b876ce9d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Sun, 15 May 2022 17:15:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=98=E5=8C=96:=20dispatc?= =?UTF-8?q?h.py=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/application/dispatch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/application/dispatch.py b/backend/application/dispatch.py index 1c01e63..213804e 100644 --- a/backend/application/dispatch.py +++ b/backend/application/dispatch.py @@ -40,15 +40,15 @@ def _get_all_system_config(): return data -def init_dictionary(schema_name=None): +def init_dictionary(): """ 初始化字典配置 :return: """ try: if is_tenants_mode(): - from django_tenants.utils import tenant_context - for tenant in get_tenant_model().objects.filter(schema_name=schema_name): + from django_tenants.utils import tenant_context, get_tenant_model + for tenant in get_tenant_model().objects.filter(): with tenant_context(tenant): settings.DICTIONARY_CONFIG[connection.tenant.schema_name] = _get_all_dictionary() else: @@ -68,8 +68,8 @@ def init_system_config(): try: if is_tenants_mode(): - from django_tenants.utils import tenant_context - for tenant in get_tenant_model().objects.filter(schema_name=schema_name): + from django_tenants.utils import tenant_context, get_tenant_model + for tenant in get_tenant_model().objects.filter(): with tenant_context(tenant): settings.SYSTEM_CONFIG[connection.tenant.schema_name] = _get_all_system_config() else: