summaryrefslogtreecommitdiff
path: root/src/leap/soledad
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/soledad')
-rw-r--r--src/leap/soledad/server/_blobs.py1
-rw-r--r--src/leap/soledad/server/_incoming.py6
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)