From 8a299558d47ed04d01b0aa396a1cfdf16c7820cd Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 12 May 2016 22:28:35 +0200 Subject: [bug] check if 'enabled' field exist in the Identity document - Related: #7961 --- src/leap/mx/couchdbhelper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3