mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
Correct deck when previewing an existing card
This commit is contained in:
parent
e22f691ae0
commit
89719ee5d5
1 changed files with 6 additions and 4 deletions
|
@ -437,10 +437,12 @@ insert into cards values (?,?,?,?,?,?,0,0,?,0,0,0,0,0,0,0,0,"")""",
|
|||
card.nid = note.id
|
||||
card.ord = template['ord']
|
||||
# Use template did (deck override) if valid, otherwise model did
|
||||
if template['did'] and str(template['did']) in self.decks.decks:
|
||||
card.did = template['did']
|
||||
else:
|
||||
card.did = note.model()['did']
|
||||
card.did = self.db.scalar("select did from cards where nid = ? and ord = ?", card.nid, card.ord)
|
||||
if not card.did:
|
||||
if template['did'] and str(template['did']) in self.decks.decks:
|
||||
card.did = template['did']
|
||||
else:
|
||||
card.did = note.model()['did']
|
||||
# if invalid did, use default instead
|
||||
deck = self.decks.get(card.did)
|
||||
if deck['dyn']:
|
||||
|
|
Loading…
Reference in a new issue