diff options
author | Ryan Petrello <lists@ryanpetrello.com> | 2013-03-12 14:34:46 -0400 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2013-03-12 14:34:46 -0400 |
commit | 1b92443d5c422e344e9bb6b98d9b07da139365f8 (patch) | |
tree | d32cc56b94abbb83cf102fdcbc9d4399afab711b /pecan/rest.py | |
parent | 2c58651b043eb7261487be6bfa40e9d90d896a01 (diff) | |
download | pecan-1b92443d5c422e344e9bb6b98d9b07da139365f8.tar.gz |
Fix a bug in DELETE methods in two (or more) nested RestControllers.
Diffstat (limited to 'pecan/rest.py')
-rw-r--r-- | pecan/rest.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pecan/rest.py b/pecan/rest.py index 2fda2a3..08b5efb 100644 --- a/pecan/rest.py +++ b/pecan/rest.py @@ -170,6 +170,11 @@ class RestController(object): ''' Routes ``DELETE`` actions to the appropriate controller. ''' + if remainder: + controller = getattr(self, remainder[0], None) + if controller and not ismethod(controller): + return lookup_controller(controller, remainder[1:]) + # check for post_delete/delete requests first controller = self._find_controller('post_delete', 'delete') if controller: @@ -211,7 +216,8 @@ class RestController(object): abort(404) - _handle_put = _handle_post + def _handle_put(self, method, remainder): + return self._handle_post(method, remainder) def _set_routing_args(self, args): ''' |