Fix in demos related to async-await syntax (#123)
- remove 3.4 version from setup.py - add cryprography package to requirements since it is used in dictionary_auth - add a few missed async kwords
This commit is contained in:
committed by
Andrew Svetlov
parent
db7dbd9b07
commit
d89f6b7e3d
@@ -10,7 +10,7 @@ class DBAuthorizationPolicy(AbstractAuthorizationPolicy):
|
||||
def __init__(self, dbengine):
|
||||
self.dbengine = dbengine
|
||||
|
||||
def authorized_userid(self, identity):
|
||||
async def authorized_userid(self, identity):
|
||||
async with self.dbengine as conn:
|
||||
where = sa.and_(db.users.c.login == identity,
|
||||
sa.not_(db.users.c.disabled))
|
||||
|
@@ -13,7 +13,7 @@ from demo.db_auth import DBAuthorizationPolicy
|
||||
from demo.handlers import Web
|
||||
|
||||
|
||||
def init(loop):
|
||||
async def init(loop):
|
||||
redis_pool = await create_pool(('localhost', 6379))
|
||||
db_engine = await create_engine(user='aiohttp_security',
|
||||
password='aiohttp_security',
|
||||
|
Reference in New Issue
Block a user