From 9ff293b850a46ef132c174a8b3499b172e35c7bd Mon Sep 17 00:00:00 2001 From: mohamad Date: Fri, 16 May 2025 22:08:47 +0200 Subject: [PATCH] Ensure database transaction is committed after list creation in the API endpoint; improve reliability of list creation process. --- be/app/api/v1/endpoints/lists.py | 1 + 1 file changed, 1 insertion(+) diff --git a/be/app/api/v1/endpoints/lists.py b/be/app/api/v1/endpoints/lists.py index b864f3d..62e4064 100644 --- a/be/app/api/v1/endpoints/lists.py +++ b/be/app/api/v1/endpoints/lists.py @@ -61,6 +61,7 @@ async def create_list( try: created_list = await crud_list.create_list(db=db, list_in=list_in, creator_id=current_user.id) + await db.commit() # Ensure the transaction is committed logger.info(f"List '{created_list.name}' (ID: {created_list.id}) created successfully for user {current_user.email}.") return created_list except DatabaseIntegrityError as e: