[web application] move default path logic inside url publisher
Previously, this logic was handle by:
* etwist server
* wsgi handler
* web application
--- a/etwist/server.py Mon Feb 27 11:50:04 2012 +0100
+++ b/etwist/server.py Mon Feb 27 11:51:09 2012 +0100
@@ -352,8 +352,6 @@
request.uri.replace(origpath, path, 1)
else:
path = origpath
- if not path or path == "/":
- path = 'view'
try:
result = self.appli.publish(path, req)
except DirectResponse, ex:
--- a/web/application.py Mon Feb 27 11:50:04 2012 +0100
+++ b/web/application.py Mon Feb 27 11:51:09 2012 +0100
@@ -347,7 +347,6 @@
:rtype: str
:return: the result of the pusblished url
"""
- path = path or 'view'
# don't log form values they may contains sensitive information
self.info('publish "%s" (%s, form params: %s)',
path, req.session.sessionid, req.form.keys())
--- a/web/views/urlpublishing.py Mon Feb 27 11:50:04 2012 +0100
+++ b/web/views/urlpublishing.py Mon Feb 27 11:51:09 2012 +0100
@@ -106,7 +106,8 @@
:param req: the request object
:type path: str
- :param path: the path of the resource to publish
+ :param path: the path of the resource to publish. If empty, None or "/"
+ "view" is used as the default path.
:rtype: tuple(str, `cubicweb.rset.ResultSet` or None)
:return: the publishing method identifier and an optional result set
--- a/wsgi/handler.py Mon Feb 27 11:50:04 2012 +0100
+++ b/wsgi/handler.py Mon Feb 27 11:51:09 2012 +0100
@@ -126,9 +126,6 @@
self.appli.connect(req)
except Redirect, ex:
return self.redirect(req, ex.location)
- path = req.path
- if not path or path == "/":
- path = 'view'
try:
result = self.appli.publish(path, req)
except DirectResponse, ex: