From 56716e7a20ff93f754350017f09db6b69d65e0e0 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 28 Aug 2012 15:36:05 -0500 Subject: [PATCH] catching AttributeError --- VERSION | 2 +- gluon/dal.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 0d57e382..43ab79e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.1 (2012-08-28 14:57:17) rc4 +Version 2.00.1 (2012-08-28 15:36:00) rc4 diff --git a/gluon/dal.py b/gluon/dal.py index ee73c25e..c9e7073b 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -1880,7 +1880,7 @@ class BaseAdapter(ConnectionPool): for item in table.virtualfields: try: rowsobj = rowsobj.setvirtualfields(**{tablename:item}) - except KeyError: + except (KeyError, AttributeError): # to avoid breaking virtualfields when partial select pass return rowsobj @@ -6946,7 +6946,7 @@ def index(): ofields = vars.get('order',db[table]._id.name).split('|') try: orderby = [db[table][f] if not f.startswith('~') else ~db[table][f[1:]] for f in ofields] - except KeyError: + except (KeyError, AttributeError): return Row({'status':400,'error':'invalid orderby','response':None}) fields = [field for field in db[table] if field.readable] count = dbset.count()