From f726def6a5afe185318a39a4ad10b667ea77bf2e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 1 Nov 2017 13:15:46 +0100 Subject: [PATCH] fireinfo: Write profiles in one transaction Signed-off-by: Michael Tremer --- webapp/handlers_fireinfo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webapp/handlers_fireinfo.py b/webapp/handlers_fireinfo.py index f35c187a..bc3d102f 100644 --- a/webapp/handlers_fireinfo.py +++ b/webapp/handlers_fireinfo.py @@ -156,11 +156,12 @@ class FireinfoProfileSendHandler(FireinfoBaseHandler): location = location.country # Handle the profile. - try: - self.fireinfo.handle_profile(public_id, profile_blob, location=location) + with self.db.transaction(): + try: + self.fireinfo.handle_profile(public_id, profile_blob, location=location) - except backend.fireinfo.ProfileParserError: - raise tornado.web.HTTPError(400) + except backend.fireinfo.ProfileParserError: + raise tornado.web.HTTPError(400) self.finish("Your profile was successfully saved to the database.") -- 2.47.3