mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-29 13:47:14 +00:00
style: format OSS account service
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user