# HG changeset patch # User Pierre-Yves David # Date 1330339869 -3600 # Node ID 18893bb969d215519c2c89bd6e57a92ee8d8cd58 # Parent 3bd9b317b1d8519596533bfc0999fad0aea79713 [web application] move default path logic inside url publisher Previously, this logic was handle by: * etwist server * wsgi handler * web application diff -r 3bd9b317b1d8 -r 18893bb969d2 etwist/server.py --- 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: diff -r 3bd9b317b1d8 -r 18893bb969d2 web/application.py --- 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()) diff -r 3bd9b317b1d8 -r 18893bb969d2 web/views/urlpublishing.py --- 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 diff -r 3bd9b317b1d8 -r 18893bb969d2 wsgi/handler.py --- 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: