is:learn should match relearning cards too - filter on queue, not type

This commit is contained in:
Damien Elmes 2012-09-03 03:20:12 +09:00
parent 7c1ff307ed
commit fa4f26e560
2 changed files with 3 additions and 3 deletions

View file

@ -257,8 +257,8 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds
elif val == "new":
n = 0
else:
n = 1
return "type = %d" % n
return "queue in (1, 3)"
return "queue = %d" % n
elif val == "suspended":
return "c.queue = -1"
elif val == "due":

View file

@ -74,7 +74,7 @@ def test_findCards():
assert len(deck.findCards('"goats are"')) == 1
# card states
c = f.cards()[0]
c.type = 2
c.queue = 2
assert deck.findCards("is:review") == []
c.flush()
assert deck.findCards("is:review") == [c.id]