fix: Load tenants to default user
This commit is contained in:
parent
a8ff50ceae
commit
0c4e3e1f52
1 changed files with 3 additions and 1 deletions
|
|
@ -18,7 +18,9 @@ async def get_default_user() -> SimpleNamespace:
|
||||||
try:
|
try:
|
||||||
async with db_engine.get_async_session() as session:
|
async with db_engine.get_async_session() as session:
|
||||||
query = (
|
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)
|
result = await session.execute(query)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue