don't genCards() into a cram deck

This commit is contained in:
Damien Elmes 2012-04-22 08:27:31 +09:00
parent 62b44df78e
commit 3c6707c17f
2 changed files with 7 additions and 0 deletions

View file

@ -318,6 +318,10 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
for t in self._tmplsFromOrds(model, avail):
doHave = nid in have and t['ord'] in have[nid]
if not doHave:
# check deck is not a cram deck
did = t['did'] or did
if self.decks.isDyn(did):
did = 1
# 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
# instead

View file

@ -417,3 +417,6 @@ class DeckManager(object):
did = self.id(name, type=defaultDynamicDeck)
self.select(did)
return did
def isDyn(self, did):
return self.get(did)['dyn']