Skip to content

Commit fae8f7d

Browse files
authored
Merge pull request #353 from Arfey/fixed-compatibility-fix-aiohttp-3
start to fix problem connected with aiohttp release 3.0.0
2 parents 9b460a5 + a3a3164 commit fae8f7d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

aiohttp_admin/admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def token(self, request):
5252
await authorize(request, data['username'], data['password'])
5353

5454
router = request.app.router
55-
location = router["admin.index"].url()
55+
location = router["admin.index"].url_for().human_repr()
5656
payload = {"location": location}
5757
response = json_response(payload)
5858
await remember(request, response, data['username'])
@@ -63,7 +63,7 @@ async def logout(self, request):
6363
msg = "Auth header is not present, can not destroy token"
6464
raise JsonValidaitonError(msg)
6565
router = request.app.router
66-
location = router["admin.login"].url()
66+
location = router["admin.login"].url_for().human_repr()
6767
payload = {"location": location}
6868
response = json_response(payload)
6969
await forget(request, response)

aiohttp_admin/backends/mongo_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def apply_trafaret(trafaret, value):
5656
validate = trafaret.check_and_return
5757

5858
if isinstance(trafaret, MongoId):
59-
validate = trafaret.converter
59+
validate = trafaret.check_and_return
6060

6161
if isinstance(value, list):
6262
try:

demos/motortwit/motortwit/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def timeline(self, request):
2626

2727
if user_id is None:
2828
router = request.app.router
29-
location = router['public_timeline'].url()
29+
location = router['public_timeline'].url_for().human_repr()
3030
raise web.HTTPFound(location=location)
3131
user = await self.mongo.user.find_one({'_id': ObjectId(user_id)})
3232

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ pytest-sugar==0.9.1
1414
pytest==3.4.1
1515
python-dateutil==2.6.1
1616
sqlalchemy==1.2.4
17-
trafaret==1.1.1
17+
trafaret==2.0.0a1
1818
pymysql==0.7.11
1919
-r requirements-doc.txt

tests/rest_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async def create(*, debug=False, ssl_ctx=None, proto='http'):
158158
url = "{}://127.0.0.1:{}".format(proto, port)
159159

160160
async def app_starter():
161-
handler = app.make_handler(keep_alive_on=False)
161+
handler = app.make_handler(tcp_keepalive=False)
162162
srv = await loop.create_server(handler, '127.0.0.1', port,
163163
ssl=ssl_ctx)
164164
cleanup.append((app, handler, srv))

0 commit comments

Comments
 (0)