-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check context's type and return context if it is not a dict #15
Conversation
|
Test passed! |
Well, redirection is good point! |
@@ -80,6 +80,9 @@ def wrapped(*args): | |||
else: | |||
coro = asyncio.coroutine(func) | |||
context = yield from coro(*args) | |||
if isinstance(context, web.Response): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be web.StreamResponse
-- top class in responses hierarchy.
Tests are required for any pull request. |
I don't really know what should I check here... Test for checking context is response is ready. |
Don't do redirect, return |
Check context's type and return context if it is not a dict
It can be in a real-world project. @aiohttp_jinja2.template has been used for a few lines shorter code.
But with checking context's type in
template
decorator it will work and http://stackoverflow.com/questions/29322753/aiohttp-and-aiohttp-jinja2-response-error will never be asked.