From d0ca61a608b8050b2ed81a6312e3af978f9e424a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 17 Jun 2021 15:51:21 +1000 Subject: [PATCH] show correct card count when removing multiple templates https://forums.ankiweb.net/t/error-in-card-type-deletion/10868 --- qt/aqt/clayout.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/aqt/clayout.py b/qt/aqt/clayout.py index 592b00965..aa1c36c0f 100644 --- a/qt/aqt/clayout.py +++ b/qt/aqt/clayout.py @@ -550,7 +550,8 @@ class CardLayout(QDialog): return def get_count() -> int: - return self.mm.template_use_count(self.model["id"], self.ord) + ord = self.current_template()["ord"] + return self.mm.template_use_count(self.model["id"], ord) def on_done(fut: Future) -> None: card_cnt = fut.result()