style: format OSS account service

This commit is contained in:
dadachann
2026-07-26 16:09:50 +08:00
parent 712f79ed77
commit 624a197655
+2 -6
View File
@@ -186,14 +186,10 @@ class UserService:
async def get_login_capabilities(self) -> dict[str, bool]: async def get_login_capabilities(self) -> dict[str, bool]:
"""Derive enabled public login methods from all active Accounts.""" """Derive enabled public login methods from all active Accounts."""
password_count = sqlalchemy.func.count().filter( password_count = sqlalchemy.func.count().filter(user.User.password.is_not(None), user.User.password != '')
user.User.password.is_not(None), user.User.password != ''
)
space_count = sqlalchemy.func.count().filter(user.User.space_account_uuid.is_not(None)) space_count = sqlalchemy.func.count().filter(user.User.space_account_uuid.is_not(None))
result = await self.ap.persistence_mgr.execute_async( result = await self.ap.persistence_mgr.execute_async(
sqlalchemy.select(password_count, space_count).where( sqlalchemy.select(password_count, space_count).where(user.User.status == user.AccountStatus.ACTIVE.value)
user.User.status == user.AccountStatus.ACTIVE.value
)
) )
password_accounts, space_accounts = result.one() password_accounts, space_accounts = result.one()
return { return {