mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
fix bug in conditional card generation
This commit is contained in:
parent
b0ad2be961
commit
8ea5f06ea6
1 changed files with 4 additions and 1 deletions
|
@ -773,10 +773,13 @@ priority != 0 and due < :now and spaceUntil > :now""",
|
|||
ok = True
|
||||
for format in [cardModel.qformat, cardModel.aformat]:
|
||||
empty = {}
|
||||
local = {}; local.update(fact)
|
||||
for k in fact.keys():
|
||||
empty[k] = u""
|
||||
empty["text:"+k] = u""
|
||||
local["text:"+k] = u""
|
||||
try:
|
||||
if format % fact == format % empty:
|
||||
if format % local == format % empty:
|
||||
ok = False
|
||||
except (KeyError, TypeError, ValueError):
|
||||
ok = False
|
||||
|
|
Loading…
Reference in a new issue