summaryrefslogtreecommitdiff
path: root/src/leap/mx/couchdbhelper.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-09-26 10:21:00 -0300
committerTomás Touceda <chiiph@leap.se>2014-09-26 10:21:00 -0300
commitd8893584886a593dd6ddcfa1a6930288c7fd8ecc (patch)
treeea78d499b35991a7e1e51ebbb8aee6fea6286ff1 /src/leap/mx/couchdbhelper.py
parent2b6ed340fd0f2f84431082890857dd5e7de63831 (diff)
parent78e8f04076c4f915b8fbdad037a863487580da5a (diff)
Merge branch 'release-0.6.0'0.6.0
Diffstat (limited to 'src/leap/mx/couchdbhelper.py')
-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