Skip to content
Snippets Groups Projects
Verified Commit eb59cbaa authored by Kevin Morris's avatar Kevin Morris
Browse files

change(python): use transaction query in BasicAuthBackend


Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent 64069b9b
No related branches found
No related tags found
No related merge requests found
...@@ -122,8 +122,8 @@ class BasicAuthBackend(AuthenticationBackend): ...@@ -122,8 +122,8 @@ class BasicAuthBackend(AuthenticationBackend):
# At this point, we cannot have an invalid user if the record # At this point, we cannot have an invalid user if the record
# exists, due to ForeignKey constraints in the schema upheld # exists, due to ForeignKey constraints in the schema upheld
# by mysqlclient. # by mysqlclient.
user = db.query(User).filter(User.ID == record.UsersID).first() with db.begin():
db.refresh(user) user = db.query(User).filter(User.ID == record.UsersID).first()
user.nonce = util.make_nonce() user.nonce = util.make_nonce()
user.authenticated = True user.authenticated = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment