From aa86bc8088114dd0cb8f4c45fd4cca0cc8e4ca30 Mon Sep 17 00:00:00 2001 From: BlueGreenMagick <50060875+BlueGreenMagick@users.noreply.github.com> Date: Tue, 7 Apr 2020 14:02:53 +0900 Subject: [PATCH] use model type to detect cloze notes --- qt/aqt/addcards.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/aqt/addcards.py b/qt/aqt/addcards.py index 0b35a47c0..8b4da53a2 100644 --- a/qt/aqt/addcards.py +++ b/qt/aqt/addcards.py @@ -7,6 +7,7 @@ import aqt.deckchooser import aqt.editor import aqt.forms import aqt.modelchooser +from anki.consts import MODEL_CLOZE from anki.lang import _ from anki.notes import Note from anki.utils import htmlToTextLine, isMac @@ -174,7 +175,7 @@ class AddCards(QDialog): if problem is not None: showWarning(problem, help="AddItems#AddError") return None - if "{{cloze:" in note.model()["tmpls"][0]["qfmt"]: + if note.model()["type"] == MODEL_CLOZE: if not self.mw.col.models._availClozeOrds( note.model(), note.joinedFields(), False ):