From fa4834a9e2dc164b505caf6ea201b26ae4ca542e Mon Sep 17 00:00:00 2001 From: chengkai3 Date: Thu, 18 Jun 2026 11:00:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:[FL-191][=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=9B=E5=BB=BA=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E4=BA=8B=E5=8A=A1=E9=94=99=E8=AF=AF]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: multica-agent --- api/app/services/user_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/services/user_service.py b/api/app/services/user_service.py index 2d03dd8..11d5218 100644 --- a/api/app/services/user_service.py +++ b/api/app/services/user_service.py @@ -115,7 +115,7 @@ def create_user( ) db.add(user) - db.commit() + db.flush() _assign_legacy_roles(db, user_id, []) write_audit_log( db, @@ -495,8 +495,8 @@ def _replace_legacy_user_roles(db: Session, user_id: str, role_ids: list[str]) - "role_id": role_id, }, ) + db.flush() except SQLAlchemyError: - db.rollback() return False return True