From a6431565d8cf4283466085562778c54e8e490461 Mon Sep 17 00:00:00 2001 From: Dzmitry Safarau Date: Sun, 26 Jun 2016 23:16:33 +0300 Subject: [PATCH] fix(rest): #96 falcon breaks compatibility. --- MonitorrentInstaller/MonitorrentInstaller/Product.wxs | 2 +- monitorrent/rest/__init__.py | 6 +++--- monitorrent/rest/login.py | 2 +- package.json | 2 +- requirements.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MonitorrentInstaller/MonitorrentInstaller/Product.wxs b/MonitorrentInstaller/MonitorrentInstaller/Product.wxs index d9292ac8..0d87b5ec 100644 --- a/MonitorrentInstaller/MonitorrentInstaller/Product.wxs +++ b/MonitorrentInstaller/MonitorrentInstaller/Product.wxs @@ -1,6 +1,6 @@ - + diff --git a/monitorrent/rest/__init__.py b/monitorrent/rest/__init__.py index c9c8a332..118ada31 100644 --- a/monitorrent/rest/__init__.py +++ b/monitorrent/rest/__init__.py @@ -26,7 +26,7 @@ class MonitorrentResponse(falcon.Response): # noinspection PyMethodMayBeStatic,PyMethodMayBeStatic,PyUnusedLocal class JSONTranslator(object): - def process_resource(self, req, resp, resource): + def process_resource(self, req, resp, resource, params): """ :type req: MonitorrentRequest :type resp: MonitorrentResponse @@ -62,12 +62,12 @@ class AuthMiddleware(object): token = None auth_enabled = None - def process_resource(self, req, resp, resource): + def process_resource(self, req, resp, resource, params): if getattr(resource, '__no_auth__', False): return if not self.validate_auth(req): - raise falcon.HTTPUnauthorized('Authentication required', 'AuthCookie is not specified') + raise falcon.HTTPUnauthorized('Authentication required', 'AuthCookie is not specified', None) @classmethod def validate_auth(cls, req): diff --git a/monitorrent/rest/login.py b/monitorrent/rest/login.py index 074472b4..3eef1124 100644 --- a/monitorrent/rest/login.py +++ b/monitorrent/rest/login.py @@ -23,7 +23,7 @@ def on_post(self, req, resp): raise falcon.HTTPBadRequest('WrongPassword', 'password is not specified') password = body['password'] if password != self.settings_manager.get_password(): - raise falcon.HTTPUnauthorized('WrongPassword', 'password is not correct') + raise falcon.HTTPUnauthorized('WrongPassword', 'password is not correct', None) AuthMiddleware.authenticate(resp) diff --git a/package.json b/package.json index 89ef39fc..1952e035 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monitorrent", - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "index.js", "directories": { diff --git a/requirements.txt b/requirements.txt index 8da3619c..91b6ba6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ beautifulsoup4>=4.4.0 deluge-client>=1.0.2 feedparser>=5.2.1 alembic>=0.7.6 -falcon +falcon>=1.0.0 itsdangerous html5lib dateutils