Ensure database transaction is committed after list creation in the API endpoint; improve reliability of list creation process.
This commit is contained in:
parent
7a88ea258a
commit
9ff293b850
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user