From 84de17dc6b6be21ee8d658d3ce284470470b29cb Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Mon, 19 Mar 2012 16:04:19 -0500 Subject: [PATCH] fixed issue 711, crud.upadate(...,next=URL(...)), thanks iceberg --- VERSION | 2 +- gluon/tools.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 3a9ba2ba..4c7eb0ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-03-19 15:55:45) dev +Version 1.99.7 (2012-03-19 16:04:11) dev diff --git a/gluon/tools.py b/gluon/tools.py index 478d977a..26181cbe 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -73,9 +73,11 @@ def call_or_redirect(f,*args): redirect(f) def replace_id(url, form): - if url and not url[0] == '/' and url[:4] != 'http': - return URL(url.replace('[id]', str(form.vars.id))) - return url + if url: + url = url.replace('[id]', str(form.vars.id)) + if url[0] == '/' or url[:4] == 'http': + return url + return URL(url) class Mail(object): """