From 53e4065e0cc13e2262b218a43f24b11e9eab90a6 Mon Sep 17 00:00:00 2001 From: Matthias Jahn Date: Sun, 30 Dec 2012 22:45:48 +0100 Subject: [PATCH 1/4] - pylons url_for deprecated. change url_for to url - fix a mistake in pagination.mako range() only accept integers --- swat/controllers/account.py | 6 +++--- swat/templates/default/component/pagination.mako | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swat/controllers/account.py b/swat/controllers/account.py index 64c1796..101555c 100644 --- a/swat/controllers/account.py +++ b/swat/controllers/account.py @@ -17,7 +17,7 @@ import logging from formencode import variabledecode from pylons import request, tmpl_context as c, url -from pylons.controllers.util import redirect, url_for +from pylons.controllers.util import redirect from swat.lib.base import BaseController, render from swat.lib.samr_manager import SAMPipeManager, User, Group @@ -137,7 +137,7 @@ class AccountController(BaseController): SwatMessages.add(message, type) if subaction == "save_add": - redirect(url_for("with_subaction", controller='account', action="user", subaction="add")) + redirect(url("with_subaction", controller='account', action="user", subaction="add")) elif subaction == "save": redirect(url(controller='account', action='user')) elif subaction == "apply": @@ -271,7 +271,7 @@ class AccountController(BaseController): SwatMessages.add(message, type) if subaction == "save_add": - redirect(url_for("with_subaction", controller='account', action="group", subaction="add")) + redirect(url("with_subaction", controller='account', action="group", subaction="add")) elif subaction == "save": redirect(url(controller='account', action='group')) elif subaction == "apply": diff --git a/swat/templates/default/component/pagination.mako b/swat/templates/default/component/pagination.mako index 3f7546e..71bb4fa 100644 --- a/swat/templates/default/component/pagination.mako +++ b/swat/templates/default/component/pagination.mako @@ -42,7 +42,7 @@ % endif - % for i in range(1, total_pages + 1): + % for i in range(1, int(total_pages + 1)): <% current_item_class = "" %> <%doc>FIXME if per_page is one all items will be highlighted -- 1.7.9.5