Merge pull request #117 from timrae/override
Don't use default deck when deck override set to invalid deck
This commit is contained in:
commit
5dca0cdf77
@ -379,7 +379,11 @@ insert into cards values (?,?,?,?,?,?,0,0,?,0,0,0,0,0,0,0,0,"")""",
|
|||||||
card = anki.cards.Card(self)
|
card = anki.cards.Card(self)
|
||||||
card.nid = note.id
|
card.nid = note.id
|
||||||
card.ord = template['ord']
|
card.ord = template['ord']
|
||||||
card.did = template['did'] or note.model()['did']
|
# Use template did (deck override) if valid, otherwise model did
|
||||||
|
if template['did'] and template['did'] in self.decks.decks:
|
||||||
|
card.did = template['did']
|
||||||
|
else:
|
||||||
|
card.did = note.model()['did']
|
||||||
# if invalid did, use default instead
|
# if invalid did, use default instead
|
||||||
deck = self.decks.get(card.did)
|
deck = self.decks.get(card.did)
|
||||||
if deck['dyn']:
|
if deck['dyn']:
|
||||||
|
Loading…
Reference in New Issue
Block a user