Ignore cache on request.get_json(cache=False) call (#2089)

* Test cache argument of Request.get_json

* Ignore cache on request.get_json(cache=False) call

Removes usage of `_cached_json` property when `get_json` is called with
disabled cache argument. (closes #2087)
This commit is contained in:
Jiri Kuncar 2016-12-21 21:08:38 +01:00 committed by Markus Unterwaditzer
parent 0e79aba40d
commit 36425d5f91
2 changed files with 10 additions and 1 deletions

View file

@ -137,7 +137,8 @@ class Request(RequestBase):
on the request.
"""
rv = getattr(self, '_cached_json', _missing)
if rv is not _missing:
# We return cached JSON only when the cache is enabled.
if cache and rv is not _missing:
return rv
if not (force or self.is_json):