dont fail if list does not exist
This commit is contained in:
parent
649b0553b4
commit
4571d5b636
1 changed files with 6 additions and 1 deletions
|
@ -141,7 +141,12 @@ class Parser(object):
|
||||||
peer = utils.get_peer(u.id)
|
peer = utils.get_peer(u.id)
|
||||||
ids = peer.info['lists'].get(name, [])
|
ids = peer.info['lists'].get(name, [])
|
||||||
else:
|
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':
|
if l.type == 'static':
|
||||||
ids = self._list_items.select().where(
|
ids = self._list_items.select().where(
|
||||||
self._list_items.columns['list_id'].is_(l.id)
|
self._list_items.columns['list_id'].is_(l.id)
|
||||||
|
|
Loading…
Reference in a new issue