From 5926e11838a6d71aa3b7865b52b2ba2fab30b203 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 17 Aug 2015 21:16:35 -0300 Subject: [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. --- common/src/leap/soledad/common/couch.py | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit v1.2.3