summaryrefslogtreecommitdiff
path: root/src/leap/soledad/backends/couch.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/soledad/backends/couch.py')
-rw-r--r--src/leap/soledad/backends/couch.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/leap/soledad/backends/couch.py b/src/leap/soledad/backends/couch.py
index 1843bad1..6440232d 100644
--- a/src/leap/soledad/backends/couch.py
+++ b/src/leap/soledad/backends/couch.py
@@ -145,7 +145,7 @@ class CouchDatabase(ObjectStoreDatabase):
has_conflicts=has_conflicts)
contents = self._database.get_attachment(cdoc, 'u1db_json')
if contents:
- doc.content = json.loads(contents.getvalue())
+ doc.content = json.loads(contents.read())
else:
doc.make_tombstone()
return doc
@@ -313,7 +313,7 @@ class CouchDatabase(ObjectStoreDatabase):
"""
# retrieve u1db data from couch db
cdoc = self._database.get(self.U1DB_DATA_DOC_ID)
- jsonstr = self._database.get_attachment(cdoc, 'u1db_json').getvalue()
+ jsonstr = self._database.get_attachment(cdoc, 'u1db_json').read()
content = json.loads(jsonstr)
# set u1db database info
#self._sync_log = content['sync_log']
@@ -410,7 +410,6 @@ class CouchServerState(ServerState):
@rtype: CouchDatabase
"""
# TODO: open couch
- from leap.soledad.backends.couch import CouchDatabase
return CouchDatabase.open_database(self.couch_url + '/' + dbname,
create=False)