possibly fixed Issue 1630:memdb id error -- tries casting None to long., thanks Luca
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.6.0-development+timestamp.2013.08.15.09.08.28
|
Version 2.6.0-development+timestamp.2013.08.15.09.21.06
|
||||||
|
|||||||
@@ -502,9 +502,8 @@ class Query(object):
|
|||||||
'Query: right side of filter must be a value or entity')
|
'Query: right side of filter must be a value or entity')
|
||||||
if isinstance(left, Field) and left.name == 'id':
|
if isinstance(left, Field) and left.name == 'id':
|
||||||
if op == '=':
|
if op == '=':
|
||||||
self.get_one = \
|
self.get_one = QueryException(
|
||||||
QueryException(tablename=left._tablename,
|
tablename=left._tablename, id=long(right or 0))
|
||||||
id=long(right))
|
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
raise SyntaxError('only equality by id is supported')
|
raise SyntaxError('only equality by id is supported')
|
||||||
|
|||||||
+1
-1
@@ -741,7 +741,7 @@ class Session(Storage):
|
|||||||
if record_id == '0':
|
if record_id == '0':
|
||||||
raise Exception('record_id == 0')
|
raise Exception('record_id == 0')
|
||||||
# Select from database
|
# Select from database
|
||||||
row = db(table.id == record_id).select()
|
row = record_id and db(table.id == record_id).select()
|
||||||
row = row and row[0] or None
|
row = row and row[0] or None
|
||||||
# Make sure the session data exists in the database
|
# Make sure the session data exists in the database
|
||||||
if not row or row.unique_key != unique_key:
|
if not row or row.unique_key != unique_key:
|
||||||
|
|||||||
Reference in New Issue
Block a user