Browse Source

Remove redundant `cache` flag

reviewable/pr1984/r1
Adam Byrtek 10 years ago committed by Markus Unterwaditzer
parent
commit
23de58682c
  1. 8
      docs/testing.rst
  2. 6
      flask/wrappers.py

8
docs/testing.rst

@ -353,3 +353,11 @@ independently of the session backend used::
Note that in this case you have to use the ``sess`` object instead of the
:data:`flask.session` proxy. The object however itself will provide the
same interface.
Testing JSON APIs
-----------------
.. versionadded:: 1.0
Flask has comprehensive

6
flask/wrappers.py

@ -18,10 +18,10 @@ from .globals import _request_ctx_stack
_missing = object()
def _get_data(req, cache):
def _get_data(req):
getter = getattr(req, 'get_data', None)
if getter is not None:
return getter(cache=cache)
return getter()
return req.data
@ -84,7 +84,7 @@ class JSONMixin(object):
# been encoded correctly as well.
charset = self.mimetype_params.get('charset')
try:
data = _get_data(self, cache)
data = _get_data(self)
if charset is not None:
rv = json.loads(data, encoding=charset)
else:

Loading…
Cancel
Save