forked from orbit-oss/flask
Merge branch 'master' into module-support
This commit is contained in:
commit
5144d3b65a
4 changed files with 42 additions and 10 deletions
7
flask.py
7
flask.py
|
|
@ -850,7 +850,7 @@ class Flask(_PackageBoundObject):
|
|||
"""Converts the return value from a view function to a real
|
||||
response object that is an instance of :attr:`response_class`.
|
||||
|
||||
The following types are allowd for `rv`:
|
||||
The following types are allowed for `rv`:
|
||||
|
||||
======================= ===========================================
|
||||
:attr:`response_class` the object is returned unchanged
|
||||
|
|
@ -866,6 +866,11 @@ class Flask(_PackageBoundObject):
|
|||
|
||||
:param rv: the return value from the view function
|
||||
"""
|
||||
if rv is None:
|
||||
from warnings import warn
|
||||
warn(Warning('View function did not return a response'),
|
||||
stacklevel=2)
|
||||
return u''
|
||||
if isinstance(rv, self.response_class):
|
||||
return rv
|
||||
if isinstance(rv, basestring):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue