Merge pull request #112 from derxe/patch-3
Fix bug where API returns noteid even when no note is added
This commit is contained in:
commit
77a558fc31
@ -725,7 +725,9 @@ class AnkiConnect:
|
||||
|
||||
collection = self.collection()
|
||||
self.startEditing()
|
||||
collection.addNote(ankiNote)
|
||||
nCardsAdded = collection.addNote(ankiNote)
|
||||
if nCardsAdded < 1:
|
||||
raise Exception('The field values you have provided would make an empty question on all cards.')
|
||||
collection.autosave()
|
||||
self.stopEditing()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user