summaryrefslogtreecommitdiff
path: root/src/leap/soledad/__init__.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-04-09 13:56:22 -0300
committerdrebs <drebs@leap.se>2013-04-09 13:56:22 -0300
commit3e0d12b8130a317c11da5145bb878b70b3bd8cac (patch)
tree6492fb450b57ee1e911b3efb0f563b9547405061 /src/leap/soledad/__init__.py
parenta8adbad77d34c66eda2a79e19b9afbc0f3d471a6 (diff)
Add check for presence of a shared db.
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r--src/leap/soledad/__init__.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index baf303e3..b636b744 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -178,6 +178,8 @@ class Soledad(object):
self.shared_db_url,
True,
token=auth_token)
+ else:
+ self._shared_db = None
def _init_config(self, **kwargs):
"""
@@ -472,8 +474,8 @@ class Soledad(object):
@rtype: LeapDocument
"""
# TODO: change below to raise appropriate exceptions
- #if not hasattr(self, '_shared_db'):
- # return None
+ if not self._shared_db:
+ return None
return self._shared_db.get_doc_unauth(self._user_hash())
def _assert_server_keys(self):
@@ -481,8 +483,8 @@ class Soledad(object):
Assert our key copies are the same as server's ones.
"""
assert self._has_keys()
- #if not hasattr(self, '_shared_db'):
- # return
+ if not self._shared_db:
+ return
doc = self._get_keys_doc()
if doc:
remote_privkey = self.decrypt(doc.content['_privkey'],