catching AttributeError
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.1 (2012-08-28 14:57:17) rc4
|
Version 2.00.1 (2012-08-28 15:36:00) rc4
|
||||||
|
|||||||
+2
-2
@@ -1880,7 +1880,7 @@ class BaseAdapter(ConnectionPool):
|
|||||||
for item in table.virtualfields:
|
for item in table.virtualfields:
|
||||||
try:
|
try:
|
||||||
rowsobj = rowsobj.setvirtualfields(**{tablename:item})
|
rowsobj = rowsobj.setvirtualfields(**{tablename:item})
|
||||||
except KeyError:
|
except (KeyError, AttributeError):
|
||||||
# to avoid breaking virtualfields when partial select
|
# to avoid breaking virtualfields when partial select
|
||||||
pass
|
pass
|
||||||
return rowsobj
|
return rowsobj
|
||||||
@@ -6946,7 +6946,7 @@ def index():
|
|||||||
ofields = vars.get('order',db[table]._id.name).split('|')
|
ofields = vars.get('order',db[table]._id.name).split('|')
|
||||||
try:
|
try:
|
||||||
orderby = [db[table][f] if not f.startswith('~') else ~db[table][f[1:]] for f in ofields]
|
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})
|
return Row({'status':400,'error':'invalid orderby','response':None})
|
||||||
fields = [field for field in db[table] if field.readable]
|
fields = [field for field in db[table] if field.readable]
|
||||||
count = dbset.count()
|
count = dbset.count()
|
||||||
|
|||||||
Reference in New Issue
Block a user