mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 00:36:38 -04:00
don't generate cards into invalid decks
This commit is contained in:
parent
0e2637a999
commit
6f90e2c445
1 changed files with 3 additions and 1 deletions
|
@ -324,10 +324,12 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
||||||
did = t['did'] or did
|
did = t['did'] or did
|
||||||
if self.decks.isDyn(did):
|
if self.decks.isDyn(did):
|
||||||
did = 1
|
did = 1
|
||||||
|
# if the deck doesn't exist, use default instead
|
||||||
|
did = self.decks.get(did)['id']
|
||||||
# we'd like to use the same due# as sibling cards, but we
|
# we'd like to use the same due# as sibling cards, but we
|
||||||
# can't retrieve that quickly, so we give it a new id
|
# can't retrieve that quickly, so we give it a new id
|
||||||
# instead
|
# instead
|
||||||
data.append((ts, nid, t['did'] or did, t['ord'],
|
data.append((ts, nid, did, t['ord'],
|
||||||
now, usn, self.nextID("pos")))
|
now, usn, self.nextID("pos")))
|
||||||
ts += 1
|
ts += 1
|
||||||
# note any cards that need removing
|
# note any cards that need removing
|
||||||
|
|
Loading…
Reference in a new issue