fix CSV import ignoring selected deck

This is a stop-gap - once the importing code is refactored, we
should pass in the desired deck directly.

https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/102
This commit is contained in:
Damien Elmes 2021-06-04 20:37:45 +10:00
parent 20276b6c48
commit f5fbad2c20

View File

@ -190,10 +190,10 @@ class ImportDialog(QDialog):
self.mw.pm.profile["allowHTML"] = self.importer.allowHTML self.mw.pm.profile["allowHTML"] = self.importer.allowHTML
self.importer.tagModified = self.frm.tagModified.text() self.importer.tagModified = self.frm.tagModified.text()
self.mw.pm.profile["tagModified"] = self.importer.tagModified self.mw.pm.profile["tagModified"] = self.importer.tagModified
did = self.deck.selected_deck_id self.mw.col.set_aux_notetype_config(
self.importer.model["did"] = did self.importer.model["id"], "lastDeck", self.deck.selected_deck_id
)
self.mw.col.models.save(self.importer.model, updateReqs=False) self.mw.col.models.save(self.importer.model, updateReqs=False)
self.mw.col.decks.select(did)
self.mw.progress.start() self.mw.progress.start()
self.mw.checkpoint(tr.actions_import()) self.mw.checkpoint(tr.actions_import())