From aeba7f1f4b597c8d402168e07ba724b153d47364 Mon Sep 17 00:00:00 2001 From: GamilSadek Date: Tue, 19 May 2026 17:16:27 +0300 Subject: [PATCH] fix: ensure book update process exits loop after successful update --- Project 2/books2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Project 2/books2.py b/Project 2/books2.py index 57ec9355..729b53b6 100644 --- a/Project 2/books2.py +++ b/Project 2/books2.py @@ -106,6 +106,7 @@ async def update_book(book: BookRequest): if BOOKS[i].id == book.id: BOOKS[i] = book book_changed = True + break if not book_changed: raise HTTPException(status_code=404, detail='Item not found')