MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / get_admin_by_username

Function get_admin_by_username

backend/app/database_ops/auth/admin/get.py:8–23  ·  view source on GitHub ↗
(
    username: str,
)

Source from the content-addressed store, hash-verified

6
7
8async def get_admin_by_username(
9 username: str,
10):
11 # 1. get from database
12 async with postgres_pool.get_db_connection() as conn:
13 row = await conn.fetchrow(
14 "SELECT * FROM app_admin WHERE username = $1",
15 username,
16 )
17
18 # 2. write to redis and return
19 if row:
20 admin = Admin.build(row)
21 return admin
22
23 return None

Callers

nothing calls this directly

Calls 2

get_db_connectionMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected