Bug Models.current() Breaking TextImporter,

Hi this passes a Notetype where a NotetypeId is expected and causes this issue

Traceback (most recent call last):
  File "aqt.debug_console", line 299, in onDebugRet
  File "<string>", line 13, in <module>
  File "anki.models", line 161, in get
  File "anki.models", line 112, in _get_cached
TypeError: unhashable type: 'dict'

Affecting use of TextImporter
importer = TextImporter(self.mw.col, path)

Traceback (most recent call last):
  File "aqt.debug_console", line 299, in onDebugRet
  File "<string>", line 26, in <module>
  File "anki.models", line 137, in current
  File "anki.models", line 161, in get
  File "anki.models", line 112, in _get_cached
TypeError: unhashable type: 'dict'

I will check if any of the other importers don’t call current() as a workaround. Crying bc istg my addon was working 2 days ago

This is old code that we won’t be spending a lot of time to maintain, but if you can bisect the recent Anki changes and figure out which commit started to break things, we may be able to provide a workaround.

Looks like I broke something. Doing a regular import reset the current deck and note type and it works now. Thanks for the response!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.