Skip to content

Commit 66b94fc

Browse files
author
Alexander Smishlajev
committed
fix RoundupRequest:
the database must not be left open when an error is raised from the constructor
1 parent d77fbc7 commit 66b94fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

roundup/xmlrpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ def __init__(self, tracker, username, password):
5151
try:
5252
userid = self.db.user.lookup(username)
5353
except KeyError: # No such user
54+
self.db.close()
5455
raise Unauthorised, 'Invalid user.'
5556
stored = self.db.user.get(userid, 'password')
5657
if stored != password: # Wrong password
58+
self.db.close()
5759
raise Unauthorised, 'Invalid user.'
5860
self.db.setCurrentUser(username)
5961

0 commit comments

Comments
 (0)