@@ -272,11 +272,7 @@ async def langChange(session: SessionDep, current_user: CurrentUser, trans: Tran
272272@router .patch ("/pwd/{id}" , summary = f"{ PLACEHOLDER_PREFIX } reset_pwd" , description = f"{ PLACEHOLDER_PREFIX } reset_pwd" )
273273@require_permissions (permission = SqlbotPermission (role = ['admin' ]))
274274@clear_cache (namespace = CacheNamespace .AUTH_INFO , cacheName = CacheName .USER_INFO , keyExpression = "id" )
275- @system_log (LogConfig (
276- operation_type = OperationType .UPDATE ,
277- module = OperationModules .USER ,
278- resource_id_expr = "id"
279- ))
275+ @system_log (LogConfig (operation_type = OperationType .RESET_PWD ,module = OperationModules .USER ,resource_id_expr = "id" ))
280276async def pwdReset (session : SessionDep , current_user : CurrentUser , trans : Trans , id : int = Path (description = f"{ PLACEHOLDER_PREFIX } uid" )):
281277 if not current_user .isAdmin :
282278 raise Exception (trans ('i18n_permission.no_permission' , url = " patch[/user/pwd/id]," , msg = trans ('i18n_permission.only_admin' )))
@@ -286,11 +282,7 @@ async def pwdReset(session: SessionDep, current_user: CurrentUser, trans: Trans,
286282
287283@router .put ("/pwd" , summary = f"{ PLACEHOLDER_PREFIX } update_pwd" , description = f"{ PLACEHOLDER_PREFIX } update_pwd" )
288284@clear_cache (namespace = CacheNamespace .AUTH_INFO , cacheName = CacheName .USER_INFO , keyExpression = "current_user.id" )
289- @system_log (LogConfig (
290- operation_type = OperationType .UPDATE ,
291- module = OperationModules .USER ,
292- result_id_expr = "id"
293- ))
285+ @system_log (LogConfig (operation_type = OperationType .UPDATE_PWD ,module = OperationModules .USER ,result_id_expr = "id" ))
294286async def pwdUpdate (session : SessionDep , current_user : CurrentUser , trans : Trans , editor : PwdEditor ):
295287 new_pwd = editor .new_pwd
296288 if not check_pwd_format (new_pwd ):
@@ -306,11 +298,7 @@ async def pwdUpdate(session: SessionDep, current_user: CurrentUser, trans: Trans
306298@router .patch ("/status" , summary = f"{ PLACEHOLDER_PREFIX } update_status" , description = f"{ PLACEHOLDER_PREFIX } update_status" )
307299@require_permissions (permission = SqlbotPermission (role = ['admin' ]))
308300@clear_cache (namespace = CacheNamespace .AUTH_INFO , cacheName = CacheName .USER_INFO , keyExpression = "statusDto.id" )
309- @system_log (LogConfig (
310- operation_type = OperationType .UPDATE ,
311- module = OperationModules .USER ,
312- resource_id_expr = "statusDto.id"
313- ))
301+ @system_log (LogConfig (operation_type = OperationType .UPDATE_STATUS ,module = OperationModules .USER , resource_id_expr = "statusDto.id" ))
314302async def statusChange (session : SessionDep , current_user : CurrentUser , trans : Trans , statusDto : UserStatus ):
315303 if not current_user .isAdmin :
316304 raise Exception (trans ('i18n_permission.no_permission' , url = ", " , msg = trans ('i18n_permission.only_admin' )))
0 commit comments