mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Cast template deck ID before checking the decks
The keys of `self.decks.decks` are unicode keys whereas `template['did']` is an integer, so `template['did'] in self.decks.decks` always fails.
This commit is contained in:
parent
3bbd0bca7e
commit
2e38174921
1 changed files with 1 additions and 1 deletions
|
@ -380,7 +380,7 @@ insert into cards values (?,?,?,?,?,?,0,0,?,0,0,0,0,0,0,0,0,"")""",
|
||||||
card.nid = note.id
|
card.nid = note.id
|
||||||
card.ord = template['ord']
|
card.ord = template['ord']
|
||||||
# Use template did (deck override) if valid, otherwise model did
|
# Use template did (deck override) if valid, otherwise model did
|
||||||
if template['did'] and template['did'] in self.decks.decks:
|
if template['did'] and unicode(template['did']) in self.decks.decks:
|
||||||
card.did = template['did']
|
card.did = template['did']
|
||||||
else:
|
else:
|
||||||
card.did = note.model()['did']
|
card.did = note.model()['did']
|
||||||
|
|
Loading…
Reference in a new issue