The correct exception to raise when a resource has its ID changed is
cherrypy.HTTPRedirect to inform user about the new resource URI.
cherrypy.InternalRedirect is for automatic redirection (without
informing the client about that).
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/wok/control/base.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/wok/control/base.py b/src/wok/control/base.py
index e9ed3c8..638e196 100644
--- a/src/wok/control/base.py
+++ b/src/wok/control/base.py
@@ -66,12 +66,12 @@ class Resource(object):
if arg is None:
arg = ''
uri_params.append(urllib2.quote(arg.encode('utf-8'),
safe=""))
- raise internal_redirect(self.uri_fmt % tuple(uri_params))
+ raise cherrypy.HTTPRedirect(self.uri_fmt % tuple(uri_params), code)
elif action_result is not None and action_result != self.ident:
uri_params = list(self.model_args[:-1])
uri_params += [urllib2.quote(action_result.encode('utf-8'),
safe="")]
- raise internal_redirect(self.uri_fmt % tuple(uri_params))
+ raise cherrypy.HTTPRedirect(self.uri_fmt % tuple(uri_params), code)
def generate_action_handler(self, action_name, action_args=None,
destructive=False):
--
2.1.0