From 5a1cdb4e033762a1d657c54e1f25f67ee2beeb45 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Thu, 19 Apr 2012 11:12:25 -0500 Subject: [PATCH] no twice no record found --- VERSION | 2 +- gluon/sqlhtml.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 95f1cd16..937309b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-04-19 11:08:58) dev +Version 1.99.7 (2012-04-19 11:12:22) dev diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 2250e43d..a69d7598 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -1746,7 +1746,7 @@ class SQLFORM(FORM): buttonclass='buttonadd', buttontext=T('Add'), buttonurl=url(args=['new',tablename]))) - if csv: + if csv and nrows: search_actions.append(gridbutton( buttonclass='buttonexport', buttontext=T('Export'), @@ -1837,8 +1837,9 @@ class SQLFORM(FORM): except SyntaxError: rows = None error = T("Query Not Supported") - message = error or T('%(nrows)s records found') % dict(nrows=nrows) - console.append(DIV(message,_class='web2py_counter')) + if nrows: + message = error or T('%(nrows)s records found') % dict(nrows=nrows) + console.append(DIV(message,_class='web2py_counter')) if rows: htmltable = TABLE(THEAD(head))