File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " cardo-python-utils"
7- version = " 0.5.dev41 "
7+ version = " 0.5.dev42 "
88description = " Python library enhanced with a wide range of functions for different scenarios."
99readme = " README.rst"
1010requires-python = " >=3.8"
Original file line number Diff line number Diff line change 11from django .conf import settings
22
33TENANT_KEY = "tenant"
4- DATABASES = settings .DATABASES
54TENANT_DATABASES = set (settings .DATABASES .keys ()) - {"default" }
65
76TENANT_AWARE_EXCLUDED_PATHS = getattr (settings , "TENANT_AWARE_EXCLUDED_PATHS" , ())
2019 if TENANT_DATABASES :
2120 DEVELOPMENT_TENANT = list (TENANT_DATABASES )[0 ]
2221 else :
23- DEVELOPMENT_TENANT = list (DATABASES .keys ())[0 ]
22+ DEVELOPMENT_TENANT = list (settings . DATABASES .keys ())[0 ]
Original file line number Diff line number Diff line change 33from contextvars import ContextVar
44from typing import Optional
55
6- from . settings import DATABASES
6+ from django . conf import settings
77
88logger = logging .getLogger (__name__ )
99
@@ -84,7 +84,7 @@ def set(tenant):
8484 # If the tenant is already set to the same value, we do nothing and return None.
8585 return None
8686
87- if tenant not in DATABASES :
87+ if tenant not in settings . DATABASES :
8888 raise ValueError (f"Tenant '{ tenant } ' not found in DATABASES settings." )
8989
9090 token = _tenant_var .set (tenant )
You can’t perform that action at this time.
0 commit comments