summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-09-04 16:02:54 -0300
committerBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-09-04 16:02:54 -0300
commit4081e30257b6b4de60d7d2098ba6ae69a99f92cf (patch)
tree535113139e07b582d3ccbabb4e8e93df749299a9 /src
parentea64e4655a27f36df830c6b7dee6f8aeb476dbb4 (diff)
Leap mx will not stop working for everyone if an user is inconsistent
Diffstat (limited to 'src')
-rw-r--r--src/leap/mx/couchdbhelper.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/mx/couchdbhelper.py b/src/leap/mx/couchdbhelper.py
index 41604ba..f20f1dd 100644
--- a/src/leap/mx/couchdbhelper.py
+++ b/src/leap/mx/couchdbhelper.py
@@ -171,7 +171,11 @@ class ConnectedCouchDB(client.CouchDB):
:rtype: str or None
"""
for row in result["rows"]:
- if row["doc"]["user_id"] == uuid:
+ user_id = row["doc"].get("user_id")
+ if not user_id:
+ print("User %s is in an inconsistent state")
+ continue
+ if user_id == uuid:
return row["value"]
return None