Skip to content

Commit e01c386

Browse files
fix: handle admin response for api and cli
1 parent f2655a4 commit e01c386

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/operation/admin.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ async def get_admins(
9797
db, offset, limit, username, sort_list if sort_list else None, return_with_count=True
9898
)
9999

100-
return AdminsResponse(
101-
admins=[AdminDetails.model_validate(admin) for admin in admins],
102-
total=total,
103-
active=active,
104-
disabled=disabled,
105-
)
100+
if self.operator_type in (OperatorType.API, OperatorType.WEB):
101+
return AdminsResponse(
102+
admins=admins,
103+
total=total,
104+
active=active,
105+
disabled=disabled,
106+
)
107+
return admins # type: ignore[return-value]
106108

107109
async def get_admins_count(self, db: AsyncSession) -> int:
108110
return await get_admins_count(db)

0 commit comments

Comments
 (0)