mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
add check for first field
This commit is contained in:
parent
7d8c0d96b5
commit
13049339ac
1 changed files with 4 additions and 0 deletions
|
@ -70,6 +70,9 @@ class NoteImporter(Importer):
|
|||
flds = flds + [None] * (self.fields() - len(flds))
|
||||
self.mapping = flds
|
||||
|
||||
def mappingOk(self):
|
||||
return self.model['flds'][0]['name'] in self.mapping
|
||||
|
||||
def foreignNotes(self):
|
||||
"Return a list of foreign notes for importing."
|
||||
assert 0
|
||||
|
@ -80,6 +83,7 @@ class NoteImporter(Importer):
|
|||
|
||||
def importNotes(self, notes):
|
||||
"Convert each card into a note, apply attributes and add to col."
|
||||
assert self.mappingOk()
|
||||
# gather checks for duplicate comparison
|
||||
csums = {}
|
||||
for csum, id in self.col.db.execute(
|
||||
|
|
Loading…
Reference in a new issue