Update tenant logic (#4122)

* k

* k

* k

* quick nit

* nit
This commit is contained in:
pablonyx
2025-02-25 19:53:46 -08:00
committed by GitHub
parent 6f389dc100
commit a98dcbc7de
58 changed files with 155 additions and 186 deletions

View File

@ -18,5 +18,7 @@ CURRENT_TENANT_ID_CONTEXTVAR: contextvars.ContextVar[
def get_current_tenant_id() -> str:
tenant_id = CURRENT_TENANT_ID_CONTEXTVAR.get()
if tenant_id is None:
if not MULTI_TENANT:
return POSTGRES_DEFAULT_SCHEMA
raise RuntimeError("Tenant ID is not set. This should never happen.")
return tenant_id