diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-04-18 11:35:06 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-04-18 11:35:06 +0200 |
commit | 415a6993a7af2083021a9a49fe7e6c9dfd854a7a (patch) | |
tree | d9f832e83d5f1b33968507a88e07ab75aba327af | |
parent | handling date formating server side (diff) | |
download | newspipe-415a6993a7af2083021a9a49fe7e6c9dfd854a7a.tar.gz newspipe-415a6993a7af2083021a9a49fe7e6c9dfd854a7a.tar.bz2 newspipe-415a6993a7af2083021a9a49fe7e6c9dfd854a7a.zip |
Use request.json if request.args is False.
-rw-r--r-- | src/web/views/api/v2/common.py | 5 |
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: |