summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-08-17 21:16:35 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-08-26 17:20:22 -0300
commit5926e11838a6d71aa3b7865b52b2ba2fab30b203 (patch)
tree0dcb4b3a6218ca1fc2ae505e34824ba2a8f8e8e2 /common
parent6ce4114a19ca8a363f264bfc654d839d266dde5c (diff)
[bug] check type before processing
Necessary methods are on CouchDocument, but we accept a Document as well, in this case self._factory is needed. Will be simpler soon.
Diffstat (limited to 'common')
-rw-r--r--common/src/leap/soledad/common/couch.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/src/leap/soledad/common/couch.py b/common/src/leap/soledad/common/couch.py
index 13808502..3ae79382 100644
--- a/common/src/leap/soledad/common/couch.py
+++ b/common/src/leap/soledad/common/couch.py
@@ -1319,6 +1319,8 @@ class CouchDatabase(CommonBackend):
'converged', at_gen is the insertion/current generation.
:rtype: (str, int)
"""
+ if type(doc) is not CouchDocument:
+ doc = self._factory(doc.doc_id, doc.rev, doc.get_json())
self._save_source_info(replica_uid, replica_gen,
replica_trans_id, number_of_docs,
doc_idx, sync_id)