Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
534 stars 44 forks source link

Cannot import a deck with modified model #28

Closed qwiglydee closed 5 years ago

qwiglydee commented 6 years ago

Tried to export a deck, modify template and import back.

Debug info: Anki 2.1.0beta38 Python 3.6.2 Qt 5.9.3 PyQt 5.9.2 Platform: Linux Flags: frz=False ao=True

Caught exception: File "/home/qmax/.local/share/Anki2/addons21/1788670778/main.py", line 23, in on_import_action AnkiJsonImporter.import_deck(aqt.mw.col, import_directory) File "/home/qmax/.local/share/Anki2/addons21/1788670778/anki_importer.py", line 72, in import_deck importer.load_from_directory(directory_path, import_media) File "/home/qmax/.local/share/Anki2/addons21/1788670778/anki_importer.py", line 48, in load_from_directory self.load_from_file(directory_path.joinpath(directory_path.name).with_suffix(DECK_FILE_EXTENSION)) File "/home/qmax/.local/share/Anki2/addons21/1788670778/anki_importer.py", line 33, in load_from_file deck.save_to_collection(self.collection) File "/home/qmax/.local/share/Anki2/addons21/1788670778/representation/deck.py", line 177, in save_to_collection note_model.save_to_collection(collection) File "/home/qmax/.local/share/Anki2/addons21/1788670778/representation/note_model.py", line 56, in save_to_collection self.update_cards(collection, note_model_dict) File "/home/qmax/.local/share/Anki2/addons21/1788670778/representation/note_model.py", line 77, in update_cards ChangeModelDialog(collection, collection.models.nids(old_model), oldmodel).exec() <class 'NameError'>: name 'ChangeModelDialog' is not defined

Stvad commented 6 years ago

My hunch is that it's a 2.1 migration problem:

  1. dialog import is not updated
  2. the actual dialog was not tested

I'll look into this when I have time, also tagging @friebetill as he did 2.1 support.

Stvad commented 6 years ago

There is actually another appearance in node.py