From 76926c953aeadd88ee12245c764e250ea2fee19d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 26 Oct 2012 19:43:34 +0900 Subject: [PATCH] make sure we don't delete cloze notes in db check --- anki/collection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anki/collection.py b/anki/collection.py index 7ca632f92..61710b6a8 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -642,6 +642,9 @@ select id from notes where mid not in """ + ids2str(self.models.ids())) self.remNotes(ids) # cards with invalid ordinal for m in self.models.all(): + # ignore clozes + if m['type'] != MODEL_STD: + continue ids = self.db.list(""" select id from cards where ord not in %s and nid in ( select id from notes where mid = ?)""" %