mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(python): use transaction query in BasicAuthBackend
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
64069b9b5d
commit
eb59cbaa39
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||||
|
with db.begin():
|
||||||
user = db.query(User).filter(User.ID == record.UsersID).first()
|
user = db.query(User).filter(User.ID == record.UsersID).first()
|
||||||
db.refresh(user)
|
|
||||||
user.nonce = util.make_nonce()
|
user.nonce = util.make_nonce()
|
||||||
user.authenticated = True
|
user.authenticated = True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue