diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-04-09 17:31:31 +0200 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-04-09 17:31:31 +0200 |
commit | 2e0d356a53182b0a4c8217c30ed097eb91063e88 (patch) | |
tree | 9fcc57ef31ce0f246bc9bc86f450d6fc8cab25b6 /app/handlers/defconf.py | |
parent | 1fb5ab7c02fce63d64aefb9dde473a6532d7474d (diff) |
Fix DELETE method for SubscriptionHandler, other fixes.
* DELETE should not contain any payload, but for the
SubscriptionHandler we make an exception since we want to be
able to 'unsubscribe' just a single email from the document.
* Reowrk check methods in the parent class, and add new check for
headers and content type.
* Fix other handlers, and tests as well.
Diffstat (limited to 'app/handlers/defconf.py')
-rw-r--r-- | app/handlers/defconf.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/handlers/defconf.py b/app/handlers/defconf.py index 3799fbb..1e03f1a 100644 --- a/app/handlers/defconf.py +++ b/app/handlers/defconf.py @@ -18,6 +18,7 @@ import tornado from functools import partial +from tornado.web import asynchronous from handlers.base import BaseHandler from models.defconfig import DEFCONFIG_COLLECTION @@ -41,9 +42,13 @@ class DefConfHandler(BaseHandler): return valid_keys.get(method, None) - def _delete(self, json_obj): + @asynchronous + def post(self, *args, **kwargs): + self.write_error(status_code=501) + + def _delete(self, defconf_id): self.executor.submit( - partial(delete, json_obj['defconf']) + partial(delete, defconf_id) ).add_done_callback( lambda future: tornado.ioloop.IOLoop.instance().add_callback( |