diff --git a/anki/collection.py b/anki/collection.py index fac6fe2f2..6cfa3a0a9 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -392,6 +392,8 @@ select id from notes where id in %s and id not in (select nid from cards)""" % self._remNotes(nids) def remEmptyCards(self, ids): + if not ids: + return if runFilter("remEmptyCards", len(ids), True): self.remCards(ids) diff --git a/anki/notes.py b/anki/notes.py index 25618c354..b1798edc5 100644 --- a/anki/notes.py +++ b/anki/notes.py @@ -157,5 +157,8 @@ insert or replace into notes values (?,?,?,?,?,?,?,?,?,?,?,?)""", def _postFlush(self): # generate missing cards if not self.newlyAdded: - ids = self.col.genCards([self.id]) - self.col.remEmptyCards(ids) + rem = self.col.genCards([self.id]) + # popping up a dialog while editing is confusing; instead we can + # document that the user should open the templates window to + # garbage collect empty cards + #self.col.remEmptyCards(ids)