[Mpuls-commits] r2729 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri May 21 19:22:30 CEST 2010


Author: bh
Date: 2010-05-21 19:22:28 +0200 (Fri, 21 May 2010)
New Revision: 2729

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/base.py
Log:
* mpulsweb/lib/base.py (BaseController.__before__): redirect_to
will also call url_for so it's actually wrong to pass the return
value of url_for to redirect_to because it will be processed
twice.  The result is not always incorrect, but if e.g. the
application is not mounted directly at "/" in the server so that
SCRIPT_NAME is not empty, SCRIPT_NAME will be added twice to the
url.  Fix this by omitting the url_for call.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-05-21 17:15:22 UTC (rev 2728)
+++ base/trunk/ChangeLog	2010-05-21 17:22:28 UTC (rev 2729)
@@ -1,5 +1,15 @@
 2010-05-21  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/base.py (BaseController.__before__): redirect_to
+	will also call url_for so it's actually wrong to pass the return
+	value of url_for to redirect_to because it will be processed
+	twice.  The result is not always incorrect, but if e.g. the
+	application is not mounted directly at "/" in the server so that
+	SCRIPT_NAME is not empty, SCRIPT_NAME will be added twice to the
+	url.  Fix this by omitting the url_for call.
+
+2010-05-21  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/config/importer.py (import_overridable_module): Only
 	append mpuls.app.root to sys.path if it's not already in the path.
 

Modified: base/trunk/mpulsweb/lib/base.py
===================================================================
--- base/trunk/mpulsweb/lib/base.py	2010-05-21 17:15:22 UTC (rev 2728)
+++ base/trunk/mpulsweb/lib/base.py	2010-05-21 17:22:28 UTC (rev 2729)
@@ -179,7 +179,7 @@
         except KeyError:
             p = str(request.path_info)
             if not p in ('/auth/login', '/auth/loginAction'):
-                redirect_to(h.url_for(controller='/auth', action='login'))
+                redirect_to(controller='/auth', action='login')
 
     def __call__(self, environ, start_response):
         """Invoke the Controller"""



More information about the Mpuls-commits mailing list