[Mpuls-commits] r3109 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 2 11:56:08 CEST 2010


Author: bh
Date: 2010-07-02 11:56:07 +0200 (Fri, 02 Jul 2010)
New Revision: 3109

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
* mpulsweb/controllers/formularpage.py: pylons.h is deprecated.
The onyl thing used from that module was 'url'.
(FormularpageController.save): Use url_for from
mpulsweb.lib.helpers instead of url from pylons.h
Fixes mpuls/issue806


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-07-02 09:02:47 UTC (rev 3108)
+++ base/trunk/ChangeLog	2010-07-02 09:56:07 UTC (rev 3109)
@@ -1,3 +1,11 @@
+2010-07-02  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/controllers/formularpage.py: pylons.h is deprecated.
+	The onyl thing used from that module was 'url'.
+	(FormularpageController.save): Use url_for from
+	mpulsweb.lib.helpers instead of url from pylons.h
+	Fixes mpuls/issue806
+
 2010-07-02 Roland Geider <roland.geider at intevation.de>
 
 	* mpulsweb/lib/helpers.py: Round up the time the session ends

Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2010-07-02 09:02:47 UTC (rev 3108)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2010-07-02 09:56:07 UTC (rev 3109)
@@ -8,7 +8,7 @@
 import formencode
 
 from pylons import request, session, c
-from pylons import g, h
+from pylons import g
 from mpulsweb.lib.translation import _
 from pylons.controllers.util import abort, redirect
 
@@ -22,7 +22,7 @@
 from mpulsweb.lib.base import BaseController, render
 from mpulsweb.lib.renderer import ViewRenderer, RepeatGroupRenderer, \
      ErrorRenderer, apply_hidden_booleans
-from mpulsweb.lib.helpers import dd_mm_YYYY as format_date
+from mpulsweb.lib.helpers import url_for, dd_mm_YYYY as format_date
 
 
 log = logging.getLogger(__name__)
@@ -202,13 +202,11 @@
             session.save()
             # How to proceed after saving the data?
             if request.params.has_key('add_rg'):
-                redirect(h.url(controller='repeatgroup', 
-                            action="new", 
-                            id=request.params.get('add_rg')))
+                redirect(url_for(controller='repeatgroup', action="new",
+                                 id=request.params.get('add_rg')))
             elif request.params.has_key('del_rg'):
-                redirect(h.url(controller='repeatgroup', 
-                            action="delete", 
-                            id=request.params.get('del_rg')))
+                redirect(url_for(controller='repeatgroup', action="delete",
+                                 id=request.params.get('del_rg')))
             elif request.params.has_key('savenext'):
                 page_id = session['navigation.tree'].getTreeItem(page_id).nextKey().key
 



More information about the Mpuls-commits mailing list