Adm global
This commit is contained in:
19
backend/debug_tenant.py
Normal file
19
backend/debug_tenant.py
Normal 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())
|
||||
Reference in New Issue
Block a user