fix error when user confirms adding cloze to basic type
This commit is contained in:
parent
ca0374782e
commit
fb5e8d5f3b
@ -232,6 +232,8 @@ class AddCards(QDialog):
|
|||||||
|
|
||||||
def _note_can_be_added(self, note: Note) -> bool:
|
def _note_can_be_added(self, note: Note) -> bool:
|
||||||
result = note.fields_check()
|
result = note.fields_check()
|
||||||
|
# no problem, duplicate, and confirmed cloze cases
|
||||||
|
problem = None
|
||||||
if result == NoteFieldsCheckResult.EMPTY:
|
if result == NoteFieldsCheckResult.EMPTY:
|
||||||
problem = tr.adding_the_first_field_is_empty()
|
problem = tr.adding_the_first_field_is_empty()
|
||||||
elif result == NoteFieldsCheckResult.MISSING_CLOZE:
|
elif result == NoteFieldsCheckResult.MISSING_CLOZE:
|
||||||
@ -241,9 +243,6 @@ class AddCards(QDialog):
|
|||||||
problem = tr.adding_cloze_outside_cloze_notetype()
|
problem = tr.adding_cloze_outside_cloze_notetype()
|
||||||
elif result == NoteFieldsCheckResult.FIELD_NOT_CLOZE:
|
elif result == NoteFieldsCheckResult.FIELD_NOT_CLOZE:
|
||||||
problem = tr.adding_cloze_outside_cloze_field()
|
problem = tr.adding_cloze_outside_cloze_field()
|
||||||
else:
|
|
||||||
# duplicate entries are allowed these days
|
|
||||||
problem = None
|
|
||||||
|
|
||||||
# filter problem through add-ons
|
# filter problem through add-ons
|
||||||
problem = gui_hooks.add_cards_will_add_note(problem, note)
|
problem = gui_hooks.add_cards_will_add_note(problem, note)
|
||||||
|
Loading…
Reference in New Issue
Block a user