From 3fd1cf0158b5ac58dbb1f1d1acf7a45a3031a7d9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 6 Apr 2012 13:34:21 +0900 Subject: [PATCH] check the first field is mapped --- aqt/importing.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aqt/importing.py b/aqt/importing.py index b4bbcaab9..0184ac2c2 100644 --- a/aqt/importing.py +++ b/aqt/importing.py @@ -130,7 +130,11 @@ you can enter it here. Use \\t to represent tab."""), self.frm.autoDetect.setText(txt) def doImport(self, update=False): - t = time.time() + self.importer.mapping = self.mapping + if not self.importer.mappingOk(): + showWarning( + _("The first field of the note type must be mapped.")) + return deck = self.deck.text().strip() if not deck: deck = _("Default") @@ -138,7 +142,6 @@ you can enter it here. Use \\t to represent tab."""), if did != self.importer.model['did']: self.importer.model['did'] = did self.mw.col.models.save(self.importer.model) - self.importer.mapping = self.mapping self.mw.progress.start(immediate=True) self.mw.checkpoint(_("Import")) try: