fix: Load tenants to default user

This commit is contained in:
Igor Ilic 2025-10-19 20:13:22 +02:00
parent a8ff50ceae
commit 0c4e3e1f52

View file

@ -18,7 +18,9 @@ async def get_default_user() -> SimpleNamespace:
try:
async with db_engine.get_async_session() as session:
query = (
select(User).options(selectinload(User.roles)).where(User.email == default_email)
select(User)
.options(selectinload(User.roles), selectinload(User.tenants))
.where(User.email == default_email)
)
result = await session.execute(query)