# HG changeset patch # User Pierre-Yves David # Date 1339680072 -7200 # Node ID 7a861620f64fca6e35dce807b2db37b0e6d30bfb # Parent 86fc11fb6f99367784ba488271a88f0ce4ae7f0b [login] redirect to real instance root if no postlogin_path is provided When not postlogin_path is provided, the login form issue a redirect to "/". The instance root may not be at "/" on the server. Then issuing a redirect to "/" send the user to the wrong location. We now redirect to "." which works fine because the "login" controller a direct children of instance root (http://babar.com/instance/login). All other redirection of the login controller use relative path too and then rely on this relative path from the login controleur to the instance root. This mechanism may be considered fragile and may deserve a proper fix. but this is to be discussed and implemented in another changeset. diff -r 86fc11fb6f99 -r 7a861620f64f web/test/unittest_views_basecontrollers.py --- a/web/test/unittest_views_basecontrollers.py Thu Jun 14 15:55:03 2012 +0200 +++ b/web/test/unittest_views_basecontrollers.py Thu Jun 14 15:21:12 2012 +0200 @@ -852,7 +852,7 @@ req = self.request() with self.assertRaises(Redirect) as cm: self.ctrl_publish(req, ctrl='login') - self.assertEqual('/', cm.exception.location) + self.assertEqual('.', cm.exception.location) if __name__ == '__main__': unittest_main() diff -r 86fc11fb6f99 -r 7a861620f64f web/views/basecontrollers.py --- a/web/views/basecontrollers.py Thu Jun 14 15:55:03 2012 +0200 +++ b/web/views/basecontrollers.py Thu Jun 14 15:21:12 2012 +0200 @@ -90,9 +90,7 @@ def publish(self, rset=None): """log in the instance""" - path = self._cw.form.get('postlogin_path') - if not path: - path = '/' + path = self._cw.form.get('postlogin_path', '.') raise Redirect(path)