@@ -11,7 +11,7 @@ def __init__(self, dbengine):
11
11
self .dbengine = dbengine
12
12
13
13
async def authorized_userid (self , identity ):
14
- async with self .dbengine as conn :
14
+ async with self .dbengine . acquire () as conn :
15
15
where = sa .and_ (db .users .c .login == identity ,
16
16
sa .not_ (db .users .c .disabled ))
17
17
query = db .users .count ().where (where )
@@ -25,7 +25,7 @@ async def permits(self, identity, permission, context=None):
25
25
if identity is None :
26
26
return False
27
27
28
- async with self .dbengine as conn :
28
+ async with self .dbengine . acquire () as conn :
29
29
where = sa .and_ (db .users .c .login == identity ,
30
30
sa .not_ (db .users .c .disabled ))
31
31
query = db .users .select ().where (where )
@@ -50,7 +50,7 @@ async def permits(self, identity, permission, context=None):
50
50
51
51
52
52
async def check_credentials (db_engine , username , password ):
53
- async with db_engine as conn :
53
+ async with db_engine . acquire () as conn :
54
54
where = sa .and_ (db .users .c .login == username ,
55
55
sa .not_ (db .users .c .disabled ))
56
56
query = db .users .select ().where (where )
0 commit comments