diff options
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/soledad/server/_blobs.py | 1 | ||||
-rw-r--r-- | src/leap/soledad/server/_incoming.py | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py index 87b171fb..f6a8cbc6 100644 --- a/src/leap/soledad/server/_blobs.py +++ b/src/leap/soledad/server/_blobs.py @@ -256,4 +256,5 @@ class BlobsServerState(object): That method is just for compatibility with CouchServerState, so IncomingAPI can change backends. """ + # TODO: deprecate/refactor it as it's here for compatibility. return self.backend diff --git a/src/leap/soledad/server/_incoming.py b/src/leap/soledad/server/_incoming.py index 6fdeb7ae..8d057ae9 100644 --- a/src/leap/soledad/server/_incoming.py +++ b/src/leap/soledad/server/_incoming.py @@ -40,6 +40,10 @@ def _get_backend_from_config(): return CouchServerState(conf['couch_url']) +def uses_legacy(db): + return hasattr(db, 'put_doc') + + class IncomingResource(Resource): isLeaf = True @@ -51,7 +55,7 @@ class IncomingResource(Resource): uuid, doc_id = request.postpath scheme = EncryptionSchemes.PUBKEY db = self.factory.open_database(uuid) - if hasattr(db, 'put_doc'): + if uses_legacy(db): doc = ServerDocument(doc_id) doc.content = self.formatter.format(request.content.read(), scheme) db.put_doc(doc) |