From d53f3b99a1f5176caa94fcbdd3e3fe59f346ece1 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 17 Sep 2013 14:23:28 +0200 Subject: more fixes for py2.5 --- pyload/web/api_app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pyload/web/api_app.py') diff --git a/pyload/web/api_app.py b/pyload/web/api_app.py index af5c3074c..d0a41b4d0 100644 --- a/pyload/web/api_app.py +++ b/pyload/web/api_app.py @@ -44,14 +44,14 @@ def call_api(func, args=""): api = get_user_api(s) if not api: - return HTTPError(401, dumps("Unauthorized"), **response.headers) + return error(401, "Unauthorized") if not PYLOAD.isAuthorized(func, api.user): - return HTTPError(403, dumps("Forbidden"), **response.headers) + return error(403, "Forbidden") if not hasattr(PYLOAD.EXTERNAL, func) or func.startswith("_"): print "Invalid API call", func - return HTTPError(404, dumps("Not Found"), **response.headers) + return error(404, "Not Found") # TODO: possible encoding # TODO Better error codes on invalid input @@ -65,7 +65,6 @@ def call_api(func, args=""): # file upload, reads whole file into memory for name, f in request.files.iteritems(): - print f.length kwargs["filename"] = f.filename kwargs[name] = f.value -- cgit v1.2.3