aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/api
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-18 11:35:06 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-18 11:35:06 +0200
commit415a6993a7af2083021a9a49fe7e6c9dfd854a7a (patch)
treed9f832e83d5f1b33968507a88e07ab75aba327af /src/web/views/api
parenthandling date formating server side (diff)
downloadnewspipe-415a6993a7af2083021a9a49fe7e6c9dfd854a7a.tar.gz
newspipe-415a6993a7af2083021a9a49fe7e6c9dfd854a7a.tar.bz2
newspipe-415a6993a7af2083021a9a49fe7e6c9dfd854a7a.zip
Use request.json if request.args is False.
Diffstat (limited to 'src/web/views/api')
-rw-r--r--src/web/views/api/v2/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/web/views/api/v2/common.py b/src/web/views/api/v2/common.py
index 64c76a7e..0d5d8090 100644
--- a/src/web/views/api/v2/common.py
+++ b/src/web/views/api/v2/common.py
@@ -75,7 +75,10 @@ class PyAggAbstractResource(Resource):
the args to parse, if None, self.attrs will be used
"""
try:
- in_values = req.json if req else (request.args or {})
+ if req:
+ in_values = req.json
+ else:
+ in_values = request.args or request.json or {}
if not in_values and allow_empty:
return {}
except BadRequest:
bgstack15