The Django Bug That Sends Emails for Orders That Never Existed

python dev.to

You have seen this bug before. Maybe you wrote it yourself. A user places an order. Your view creates the order, sends a confirmation email, and returns a success response. Everything looks fine. Then the database throws an error halfway through. The transaction rolls back. The order never exists in the database. But the email already went out. The customer gets a confirmation for an order that does not exist. Your support inbox fills up. You spend an hour debugging something that should nev

Read Full Tutorial open_in_new
arrow_back Back to Tutorials