From 3a87d3bf6e5e7525c3b381df94b4d3c1304d237b Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 17 Feb 2007 19:16:45 +0000 Subject: [PATCH 1/1] =?utf8?q?Arreglar=20=C3=BAltimos=20usos=20malos=20de?= =?utf8?q?=20flash().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- sercom/subcontrollers/validate.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sercom/subcontrollers/validate.py b/sercom/subcontrollers/validate.py index 1495a9a..345d92b 100644 --- a/sercom/subcontrollers/validate.py +++ b/sercom/subcontrollers/validate.py @@ -2,7 +2,7 @@ __all__ = ('validate_get', 'validate_set', 'validate_new') -from turbogears import redirect +from turbogears import redirect, flash from cherrypy import NotFound def validate_get(cls, name, id, url='../list'): @@ -16,13 +16,13 @@ def validate_set(cls, name, id, data, url='../edit'): try: r.set(**data) except Exception, e: - raise redirect('%s/%s' % (url, id), tg_flash=_(u'No se pudo ' \ - 'modificar el %s (error: %s).') % (name, e), **data) + flash(_(u'No se pudo modificar el %s (error: %s).') % (name, e)) + raise redirect('%s/%s' % (url, id), **data) def validate_new(cls, name, data, url='new'): try: return cls(**data) except Exception, e: - raise redirect(url, tg_flash=_(u'No se pudo crear el nuevo %s ' \ - '(error: %s).') % (name, e), **data) + flash(_(u'No se pudo crear el nuevo %s (error: %s).') % (name, e)) + raise redirect(url, **data) -- 2.43.0