aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/api
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-18 22:38:33 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-18 22:38:33 +0200
commit82ac2aa7628e83c01f776864d88c218f388a6516 (patch)
treed93f1ac4a58cd3788f86b74457e3ecc038f6c672 /src/web/views/api
parentmodels.Article is not imported here... (diff)
downloadnewspipe-82ac2aa7628e83c01f776864d88c218f388a6516.tar.gz
newspipe-82ac2aa7628e83c01f776864d88c218f388a6516.tar.bz2
newspipe-82ac2aa7628e83c01f776864d88c218f388a6516.zip
set the default value of the parse with the values from the request.
Diffstat (limited to 'src/web/views/api')
-rw-r--r--src/web/views/api/v2/common.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/web/views/api/v2/common.py b/src/web/views/api/v2/common.py
index 0d5d8090..0227d6cf 100644
--- a/src/web/views/api/v2/common.py
+++ b/src/web/views/api/v2/common.py
@@ -100,8 +100,9 @@ class PyAggAbstractResource(Resource):
if not default and attr_name not in in_values:
continue
else:
- parser.add_argument(attr_name, location='json', **attr)
- return parser.parse_args(req=req, strict=strict)
+ parser.add_argument(attr_name, location='json',
+ default=in_values[attr_name])
+ return parser.parse_args(req=request.args, strict=strict)
class PyAggResourceNew(PyAggAbstractResource):
bgstack15