fix(deps): use NULLIF for tenant_id cast in plugin activation check
current_setting returns empty string when tenant context is not set. Casting empty string to uuid fails. Use NULLIF to convert to NULL.
This commit is contained in:
+1
-1
@@ -391,7 +391,7 @@ def require_active_plugin(plugin_name: str):
|
||||
from sqlalchemy import text as sa_text
|
||||
|
||||
result = await db.execute(
|
||||
sa_text("SELECT current_setting('app.current_tenant_id', true)::uuid")
|
||||
sa_text("SELECT NULLIF(current_setting('app.current_tenant_id', true), '')::uuid")
|
||||
)
|
||||
tenant_id = result.scalar()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user