From 415a6993a7af2083021a9a49fe7e6c9dfd854a7a Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 18 Apr 2016 11:35:06 +0200 Subject: Use request.json if request.args is False. --- src/web/views/api/v2/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/web/views/api/v2') 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: -- cgit