summaryrefslogtreecommitdiff
path: root/shared_db.py
diff options
context:
space:
mode:
Diffstat (limited to 'shared_db.py')
-rw-r--r--shared_db.py21
1 files changed, 3 insertions, 18 deletions
diff --git a/shared_db.py b/shared_db.py
index 9694db2b..c27bba71 100644
--- a/shared_db.py
+++ b/shared_db.py
@@ -99,21 +99,6 @@ class SoledadSharedDatabase(http_database.HTTPDatabase):
"""
Modified method to allow for unauth request.
"""
- try:
- res, headers = self._request(
- 'GET', ['doc', doc_id], {"include_deleted": False},
- auth=False)
- except errors.DocumentDoesNotExist:
- return None
- except errors.HTTPError, e:
- if (e.status == http_database.DOCUMENT_DELETED_STATUS and
- 'x-u1db-rev' in e.headers):
- res = None
- headers = e.headers
- else:
- raise
- doc_rev = headers['x-u1db-rev']
- has_conflicts = json.loads(headers['x-u1db-has-conflicts'])
- doc = self._factory(doc_id, doc_rev, res)
- doc.has_conflicts = has_conflicts
- return doc
+ db = http_database.HTTPDatabase(self._url, factory=self._factory,
+ creds=self._creds)
+ return db.get_doc(doc_id)