~foosoft/anki-connect

600979e74536c8ffe6dffdc1cca780d7e8bd5c76 — derxe 6 years ago 0db93be
Fix bug where API returns noteid even when no note is added
1 files changed, 3 insertions(+), 1 deletions(-)

M AnkiConnect.py
M AnkiConnect.py => AnkiConnect.py +3 -1
@@ 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()


Do not follow this link