Make get_ in webdav more fault tolerant for issue98
This commit is contained in:
1 parent
8d61d9fe2b
commit
86a713e9f7
1 file changed
+4
-2
@@ -224,7 +224,8 @@ class Collection(OSV):
|
||||
cursor.execute('SELECT EXTRACT(epoch FROM create_date) ' \
|
||||
'FROM "' + model_obj._table +'" ' \
|
||||
'WHERE id = %s', (object_id,))
|
||||
return cursor.fetchone()[0]
|
||||
if cursor.rowcount:
|
||||
return cursor.fetchone()[0]
|
||||
return time.time()
|
||||
|
||||
def get_lastmodified(self, cursor, user, uri, context=None):
|
||||
@@ -235,7 +236,8 @@ class Collection(OSV):
|
||||
cursor.execute('SELECT EXTRACT(epoch FROM write_date) ' \
|
||||
'FROM "' + model_obj._table +'" ' \
|
||||
'WHERE id = %s', (object_id,))
|
||||
return cursor.fetchone()[0]
|
||||
if cursor.rowcount:
|
||||
return cursor.fetchone()[0]
|
||||
return time.time()
|
||||
|
||||
def get_data(self, cursor, user, uri, context=None):
|
||||
|
||||
Reference in new issue
Block a user