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:
Grygorii Yermolenko
2018-01-02 14:31:19 +02:00
committed by Andrew Svetlov
parent db7dbd9b07
commit d89f6b7e3d
4 changed files with 3 additions and 3 deletions

View File

@@ -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))

View File

@@ -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',