Merge pull request #542 from BlueGreenMagick/addcards-cloze-warning

detect cloze cards with other filters
This commit is contained in:
Damien Elmes 2020-04-08 16:30:00 +10:00 committed by GitHub
commit 3851246d60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
):