mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Merge pull request #353 from Arthur-Milchior/correctFindFlag
Correct find flag
This commit is contained in:
commit
fe599522ef
2 changed files with 6 additions and 1 deletions
|
@ -275,7 +275,7 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds
|
|||
|
||||
def _findFlag(self, args):
|
||||
(val, args) = args
|
||||
if not val or val not in "01234":
|
||||
if not val or len(val)!=1 or val not in "01234":
|
||||
return
|
||||
val = int(val)
|
||||
mask = 2**3 - 1
|
||||
|
|
|
@ -224,6 +224,11 @@ def test_findCards():
|
|||
id)
|
||||
assert len(deck.findCards("added:1")) == deck.cardCount() - 1
|
||||
assert len(deck.findCards("added:2")) == deck.cardCount()
|
||||
# flag
|
||||
with assert_raises(Exception):
|
||||
deck.findCards("flag:01")
|
||||
with assert_raises(Exception):
|
||||
deck.findCards("flag:12")
|
||||
|
||||
def test_findReplace():
|
||||
deck = getEmptyCol()
|
||||
|
|
Loading…
Reference in a new issue