Ajatt-Tools/mortician

Addon crash error

Closed this issue · 2 comments

Since the latest update the addon gives an error message sometimes.

The error message:
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-08-01 12:32:32
Add-ons possibly involved: ⁨Mortician⁩

Caught exception:
Traceback (most recent call last):
File "aqt/reviewer.py", line 304, in
File "aqt/reviewer.py", line 271, in _answerCard
File "aqt/hooks_gen.py", line 2279, in call
File "/Users/casperthalen/Library/Application Support/Anki2/addons21/1255924302/mortician.py", line 82, in on_did_answer_card
act_on_card(reviewer.mw.col, card)
File "/Users/casperthalen/Library/Application Support/Anki2/addons21/1255924302/mortician.py", line 46, in act_on_card
if config['tag'] and not (note := card.note()).has_tag(config['tag']):
AttributeError: 'Note' object has no attribute 'has_tag'

My settings:
{
"again_notify": false,
"again_threshold": 5,
"count_from_daystart": true,
"disable_tooltips": false,
"flag": "",
"ignore_new_cards": true,
"new_again_threshold": 5,
"no_bury": false,
"tag": "potential_leech",
"timeframe": 24,
"tooltip_duration": 7
}

The error occurs when I select fail, and after closing the error message I can press fail without the error popping up (for that rep at least)

I do not know much more, as I have had no time to investigate, however, it hasn't happend on any first rep of a card

Have you tried updating your add-ons? I also recommend updating Anki because you're running an old version.

That fixed it, I was unaware there was an update!