From 0ff99d87be2d40cd385d505be5ad301543294b56 Mon Sep 17 00:00:00 2001 From: Cayenne Date: Thu, 10 May 2012 23:10:55 -0400 Subject: [PATCH] Included crammed cards in count for deck deletion warning Previously, when a deck was being crammed, there was no warning about it containing cards when it was deleted. Then when the cram deck was deleted, which there is never any warning about, cards ended up deckless without there ever having been any clear warning that that would happen. --- aqt/deckbrowser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aqt/deckbrowser.py b/aqt/deckbrowser.py index a7688d297..6f1f9bffc 100644 --- a/aqt/deckbrowser.py +++ b/aqt/deckbrowser.py @@ -233,8 +233,8 @@ body { margin: 1em; -webkit-user-select: none; } if not deck['dyn']: dids = [did] + [r[1] for r in self.mw.col.decks.children(did)] cnt = self.mw.col.db.scalar( - "select count() from cards where did in %s" % - ids2str(dids)) + "select count() from cards where did in {0} or " + "odid in {0}".format(ids2str(dids))) if cnt: extra = _(" It has %d cards.") % cnt else: