From: Michael Tremer Date: Tue, 7 May 2019 15:54:17 +0000 (+0100) Subject: Revert "auth: Wrap login and logout in a single transaction" X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=906e1e6a6af385f69a681ab4245e2057cbf4035a;p=ipfire.org.git Revert "auth: Wrap login and logout in a single transaction" This reverts commit 32d0ee1cba55825d13b192c6d53d8bd507d76a6b. Signed-off-by: Michael Tremer --- diff --git a/src/web/auth.py b/src/web/auth.py index 2fc70eec..e080ff70 100644 --- a/src/web/auth.py +++ b/src/web/auth.py @@ -20,9 +20,8 @@ class AuthenticationMixin(object): def login(self, account): # User has logged in, create a session - with self.db.transaction(): - session_id, session_expires = self.backend.accounts.create_session( - account, self.request.host) + session_id, session_expires = self.backend.accounts.create_session( + account, self.request.host) # Check if a new session was created if not session_id: @@ -37,10 +36,7 @@ class AuthenticationMixin(object): if not session_id: return - # Destroy session - with self.db.transaction(): - success = self.backend.accounts.destroy_session(session_id, self.request.host) - + success = self.backend.accounts.destroy_session(session_id, self.request.host) if success: self.clear_cookie("session_id")