[Mpuls-commits] r5832 - in base/trunk/mpulsweb: controllers lib

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 27 11:11:30 CET 2012


Author: roland
Date: 2012-02-27 11:11:30 +0100 (Mon, 27 Feb 2012)
New Revision: 5832

Modified:
   base/trunk/mpulsweb/controllers/administration.py
   base/trunk/mpulsweb/lib/base.py
Log:
Replace the deprecated redirect_to() with redirect(url())

Modified: base/trunk/mpulsweb/controllers/administration.py
===================================================================
--- base/trunk/mpulsweb/controllers/administration.py	2012-02-27 10:06:40 UTC (rev 5831)
+++ base/trunk/mpulsweb/controllers/administration.py	2012-02-27 10:11:30 UTC (rev 5832)
@@ -33,11 +33,13 @@
 import logging
 import formencode
 
-from pylons import request, tmpl_context as c
+from pylons import request, tmpl_context as c, url
+from pylons.controllers.util import redirect
+
 from mpulsweb.lib.translation import _
 
 from mpulsweb.lib.db import db
-from mpulsweb.lib.base import BaseController, render, redirect_to, session
+from mpulsweb.lib.base import BaseController, render, session
 from mpulsweb.lib.helpers import url_for
 from mpulsweb.lib.security import checkRole, getDbName
 from mpulsweb.lib.validators import ValidatorStateObject, NewUserGroupForm, \
@@ -334,7 +336,7 @@
             except formencode.Invalid, error:
                 return self.deleteUser(form_result.get('user_id'), '1')
         else:
-            redirect_to(controller="/administration", action='overviewUser')
+            redirect(url(controller="/administration", action='overviewUser'))
 
     # USERGROUPS
     @checkRole('admin')

Modified: base/trunk/mpulsweb/lib/base.py
===================================================================
--- base/trunk/mpulsweb/lib/base.py	2012-02-27 10:06:40 UTC (rev 5831)
+++ base/trunk/mpulsweb/lib/base.py	2012-02-27 10:11:30 UTC (rev 5832)
@@ -38,9 +38,9 @@
 from routes import url_for
 
 from pylons import tmpl_context as c, config, app_globals as g, \
-                   request, response
+                   request, response, url
 from pylons.controllers import WSGIController
-from pylons.controllers.util import redirect_to, redirect
+from pylons.controllers.util import redirect
 #from mpulsweb.lib.translation import _
 #from pylons.templating import render_mako as render
 from pylons.templating import cached_template, pylons_globals 
@@ -60,7 +60,7 @@
 # reasons.  Ideally the module should probably only export
 # BaseController and render which are customarily imported from this
 # module in Pylons.
-__all__ = ["_", "BaseController", "c", "g", "h", "redirect_to", "render",
+__all__ = ["_", "BaseController", "c", "g", "h", "redirect", "render",
            "request", "response", "session"]
 
 
@@ -241,14 +241,14 @@
             log.debug('User needs new pass: %s' % user.needsNewPass())
             if (not user.isActivated() and
                 request.path_info not in ['/auth/accountDeactivated']):
-                redirect_to('/auth/accountDeactivated')
+                redirect(url('/auth/accountDeactivated'))
 
             # Do the user needs to change his passwort?
             elif (user.needsNewPass() and
                   request.path_info not in
                   ['/usersettings/changePasswordOnLogin',
                    '/usersettings/changePasswordOnLoginAction']):
-                redirect_to('/usersettings/changePasswordOnLogin')
+                redirect(url('/usersettings/changePasswordOnLogin'))
 
         except KeyError:
             p = str(request.path_info)



More information about the Mpuls-commits mailing list