From fb5e8d5f3b21fc728922084d7eec94ad3a783936 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 26 Jun 2021 08:35:24 +1000 Subject: [PATCH] fix error when user confirms adding cloze to basic type --- qt/aqt/addcards.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qt/aqt/addcards.py b/qt/aqt/addcards.py index 56655bc9d..0ea042be8 100644 --- a/qt/aqt/addcards.py +++ b/qt/aqt/addcards.py @@ -232,6 +232,8 @@ class AddCards(QDialog): def _note_can_be_added(self, note: Note) -> bool: result = note.fields_check() + # no problem, duplicate, and confirmed cloze cases + problem = None if result == NoteFieldsCheckResult.EMPTY: problem = tr.adding_the_first_field_is_empty() elif result == NoteFieldsCheckResult.MISSING_CLOZE: @@ -241,9 +243,6 @@ class AddCards(QDialog): problem = tr.adding_cloze_outside_cloze_notetype() elif result == NoteFieldsCheckResult.FIELD_NOT_CLOZE: problem = tr.adding_cloze_outside_cloze_field() - else: - # duplicate entries are allowed these days - problem = None # filter problem through add-ons problem = gui_hooks.add_cards_will_add_note(problem, note)