diff --git a/oml/queryparser.py b/oml/queryparser.py index e0ea28e..5a7da93 100644 --- a/oml/queryparser.py +++ b/oml/queryparser.py @@ -141,7 +141,12 @@ class Parser(object): peer = utils.get_peer(u.id) ids = peer.info['lists'].get(name, []) else: - l = self._list.query.filter_by(user_id=u.id, name=name).one() + l = self._list.query.filter_by(user_id=u.id, name=name).first() + if not l: + q = operators.eq(self._model.id, '') + if exclude: + q = ~q + return q if l.type == 'static': ids = self._list_items.select().where( self._list_items.columns['list_id'].is_(l.id)