From 7c1f90bac429ef39ae3d1c6b4aece03e24202a96 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 2 Oct 2017 15:14:11 +0000 Subject: Fix: handle apifw changes (raw_uri_path kwarg) Handle it by ignoring it, until we need it. --- ick2/controllerapi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ick2/controllerapi.py') diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index af387ec..70877f1 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -65,6 +65,8 @@ class ControllerAPI: def get_callback(self, callback): # pragma: no cover def wrapper(content_type, body, **kwargs): try: + if 'raw_uri_path' in kwargs: + del kwargs['raw_uri_path'] body = callback(**kwargs) except ick2.NotFound as e: return apifw.Response({ @@ -82,7 +84,7 @@ class ControllerAPI: return wrapper def post_callback(self, callback): # pragma: no cover - def wrapper(content_type, body): + def wrapper(content_type, body, **kwargs): body = callback(body) ick2.log.log('trace', msg_text='returned body', body=repr(body)) return apifw.Response({ @@ -96,6 +98,8 @@ class ControllerAPI: def put_callback(self, callback): # pragma: no cover def wrapper(content_type, body, **kwargs): + if 'raw_uri_path' in kwargs: + del kwargs['raw_uri_path'] body = callback(body, **kwargs) ick2.log.log('trace', msg_text='returned body', body=repr(body)) return apifw.Response({ -- cgit v1.2.1