aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/api/v2/common.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-15 07:23:28 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-15 07:23:28 +0200
commit7a4a8fccd522397eda506a4483e923148dfc31b6 (patch)
treefad7304cd7b88b9b35dda449813af92832fdd174 /src/web/views/api/v2/common.py
parentMerge branch 'new-api' (diff)
parentFixed a bug recently introduced that caused problems to the mobile app. (diff)
downloadnewspipe-7a4a8fccd522397eda506a4483e923148dfc31b6.tar.gz
newspipe-7a4a8fccd522397eda506a4483e923148dfc31b6.tar.bz2
newspipe-7a4a8fccd522397eda506a4483e923148dfc31b6.zip
Merge branch 'new-api'
Diffstat (limited to 'src/web/views/api/v2/common.py')
-rw-r--r--src/web/views/api/v2/common.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/web/views/api/v2/common.py b/src/web/views/api/v2/common.py
index 092b33b0..570e088b 100644
--- a/src/web/views/api/v2/common.py
+++ b/src/web/views/api/v2/common.py
@@ -39,7 +39,7 @@ def authenticate(func):
if request.authorization:
ucontr = UserController()
try:
- user = ucontr.get(login=request.authorization.username)
+ user = ucontr.get(nickname=request.authorization.username)
except NotFound:
raise Forbidden("Couldn't authenticate your user")
if not ucontr.check_password(user, request.authorization.password):
@@ -75,7 +75,7 @@ class PyAggAbstractResource(Resource):
the args to parse, if None, self.attrs will be used
"""
try:
- in_values = req.json if req else (request.json or {})
+ in_values = req.json if req else (request.args or {})
if not in_values and allow_empty:
return {}
except BadRequest:
@@ -98,8 +98,7 @@ class PyAggAbstractResource(Resource):
continue
else:
parser.add_argument(attr_name, location='json', **attr)
- #return parser.parse_args(req=req, strict=strict)
- return attrs
+ return parser.parse_args(req=req, strict=strict)
class PyAggResourceNew(PyAggAbstractResource):
bgstack15