dabo Commit
Revision 5514
Date: 2009-11-13 14:27:39 -0800 (Fri, 13 Nov 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5514

Changed:
U   trunk/dabo/lib/datanav/Page.py

Log:
When testing, bizobj can be None. This code is now properly indented to not
run in this case.


Diff:
Modified: trunk/dabo/lib/datanav/Page.py
===================================================================
--- trunk/dabo/lib/datanav/Page.py      2009-11-09 22:44:44 UTC (rev 5513)
+++ trunk/dabo/lib/datanav/Page.py      2009-11-13 22:27:39 UTC (rev 5514)
@@ -366,7 +366,7 @@
                frm = self.Form
                bizobj = frm.getBizobj()
                ret = False
-               if bizobj is not None:
+               if bizobj:
                        sql = frm.CustomSQL
                        if sql is not None:
                                bizobj.UserSQL = sql
@@ -384,14 +384,14 @@
        
                        ret = frm.requery(_fromSelectPage=True)
 
-               if bizobj.RowCount > 0: # don't bother applying this if there 
are no records to work on
-                       # filter virtual fields
-                       for vField in self.__virtualFilters:
-                               opVal = self.selectFields[vField]["op"].Value
-                               ctrl = self.selectFields[vField]["ctrl"]
+                       if bizobj.RowCount > 0:  # don't bother applying this 
if there are no records to work on
+                               # filter virtual fields
+                               for vField in self.__virtualFilters:
+                                       opVal = 
self.selectFields[vField]["op"].Value
+                                       ctrl = self.selectFields[vField]["ctrl"]
 
-                               if not _(IGNORE_STRING) in opVal:
-                                       bizobj.filter(vField, ctrl.Value, 
opVal.lower())
+                                       if not _(IGNORE_STRING) in opVal:
+                                               bizobj.filter(vField, 
ctrl.Value, opVal.lower())
 
                if ret:
                        if self.Parent.SelectedPageNumber == 0:



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to