Adm global

This commit is contained in:
2026-03-11 09:26:36 -06:00
parent 3f7b166767
commit 12cbbd1b80
29 changed files with 61 additions and 672 deletions

19
backend/debug_tenant.py Normal file
View File

@@ -0,0 +1,19 @@
import asyncio
from app.core.database import AsyncSessionLocal
from app.models.user import User
from app.models.tenant import Tenant
from sqlalchemy import select
async def check():
async with AsyncSessionLocal() as db:
result = await db.execute(
select(User, Tenant).join(Tenant).where(User.email == 'javier@ventas.com')
)
user, tenant = result.one()
print(f"user.tenant_id: {user.tenant_id}")
print(f"tenant.id: {tenant.id}")
print(f"tenant.slug: {tenant.slug}")
print(f"user.role: {user.role}")
print(f"role.is_client: {user.role.is_client}")
asyncio.run(check())