Skip to content

Commit

Permalink
Merge pull request #353 from Arfey/fixed-compatibility-fix-aiohttp-3
Browse files Browse the repository at this point in the history
start to fix problem connected with aiohttp release 3.0.0
  • Loading branch information
jettify authored Mar 21, 2018
2 parents 9b460a5 + a3a3164 commit fae8f7d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions aiohttp_admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def token(self, request):
await authorize(request, data['username'], data['password'])

router = request.app.router
location = router["admin.index"].url()
location = router["admin.index"].url_for().human_repr()
payload = {"location": location}
response = json_response(payload)
await remember(request, response, data['username'])
Expand All @@ -63,7 +63,7 @@ async def logout(self, request):
msg = "Auth header is not present, can not destroy token"
raise JsonValidaitonError(msg)
router = request.app.router
location = router["admin.login"].url()
location = router["admin.login"].url_for().human_repr()
payload = {"location": location}
response = json_response(payload)
await forget(request, response)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp_admin/backends/mongo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def apply_trafaret(trafaret, value):
validate = trafaret.check_and_return

if isinstance(trafaret, MongoId):
validate = trafaret.converter
validate = trafaret.check_and_return

if isinstance(value, list):
try:
Expand Down
2 changes: 1 addition & 1 deletion demos/motortwit/motortwit/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def timeline(self, request):

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

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ pytest-sugar==0.9.1
pytest==3.4.1
python-dateutil==2.6.1
sqlalchemy==1.2.4
trafaret==1.1.1
trafaret==2.0.0a1
pymysql==0.7.11
-r requirements-doc.txt
2 changes: 1 addition & 1 deletion tests/rest_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async def create(*, debug=False, ssl_ctx=None, proto='http'):
url = "{}://127.0.0.1:{}".format(proto, port)

async def app_starter():
handler = app.make_handler(keep_alive_on=False)
handler = app.make_handler(tcp_keepalive=False)
srv = await loop.create_server(handler, '127.0.0.1', port,
ssl=ssl_ctx)
cleanup.append((app, handler, srv))
Expand Down

0 comments on commit fae8f7d

Please sign in to comment.