summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2016-05-12 22:28:35 +0200
committerRuben Pollan <meskio@sindominio.net>2017-01-26 22:39:31 +0100
commitb293abaa52bffa705f4012d9726296c21db482c8 (patch)
tree74fe42127480f10f6d7bf21ea773be5a111d92da
parent3a25464e92acd3fb0192c2d438a2c2122ca526fd (diff)
[bug] check if 'enabled' field exist in the Identity document
- Related: #7961
-rw-r--r--src/leap/mx/couchdbhelper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/leap/mx/couchdbhelper.py b/src/leap/mx/couchdbhelper.py
index e9cf4a4..f17466d 100644
--- a/src/leap/mx/couchdbhelper.py
+++ b/src/leap/mx/couchdbhelper.py
@@ -100,13 +100,14 @@ class ConnectedCouchDB(client.CouchDB):
pubkey = None
if result["rows"]:
doc = result["rows"][0]["doc"]
- if doc["enabled"]:
+ if "enabled" not in doc or doc["enabled"]:
uuid = doc["user_id"]
if "keys" in doc:
pubkey = doc["keys"]["pgp"]
return uuid, pubkey
d.addCallback(_get_uuid_and_pubkey_cbk)
+ d.addErrback(lambda _: (None, None))
return d
def getPubkey(self, uuid):