From 80e3a30e1f642d6f459ecaf842925b77786af8e8 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Sun, 26 Feb 2017 21:37:47 +0100 Subject: [PATCH] check for wrong entries in settings --- ibt2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibt2.py b/ibt2.py index 873b9f9..d8d73af 100755 --- a/ibt2.py +++ b/ibt2.py @@ -556,7 +556,7 @@ class SettingsHandler(BaseHandler): if id_ is not None: query['_id'] = id_ res = self.db.query(self.collection, query) - res = dict((i.get('_id'), i.get('value')) for i in res if '_id' in i) + res = dict((i.get('_id'), i.get('value')) for i in res if '_id' in i and isinstance(i.get('_id'), str)) if id_ is not None: res = {id_: res.get(id_)} self.write(res)