MCPcopy Index your code
hub / github.com/dataease/SQLBot / single_delete

Function single_delete

backend/apps/system/crud/user.py:68–76  ·  view source on GitHub ↗
(session: SessionDep, id: int)

Source from the content-addressed store, hash-verified

66
67@clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.USER_INFO, keyExpression="id")
68async def single_delete(session: SessionDep, id: int):
69 user_model: UserModel = get_db_user(session = session, user_id = id)
70 del_stmt = sqlmodel_delete(UserWsModel).where(UserWsModel.uid == id)
71 session.exec(del_stmt)
72 if user_model and user_model.origin and user_model.origin != 0:
73 platform_del_stmt = sqlmodel_delete(UserPlatformModel).where(UserPlatformModel.uid == id)
74 session.exec(platform_del_stmt)
75 session.delete(user_model)
76 session.commit()
77
78@clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.USER_INFO, keyExpression="id")
79async def clean_user_cache(id: int):

Callers 2

deleteFunction · 0.90
batch_delFunction · 0.90

Calls 3

get_db_userFunction · 0.85
execMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected