From 6532023c3eb7ad69f1ca9e528a1a467a26ebe448 Mon Sep 17 00:00:00 2001 From: Arthur-Milchior Date: Sun, 17 Feb 2019 19:26:31 +0100 Subject: [PATCH] Correcting a small bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I though «addMode» meant «call from addcard window». Instead, to know whether parent is addcard, I check whether it has attribute deckChooser --- aqt/clayout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aqt/clayout.py b/aqt/clayout.py index 2e9764cee..037f3b954 100644 --- a/aqt/clayout.py +++ b/aqt/clayout.py @@ -61,7 +61,9 @@ class CardLayout(QDialog): self.setFocus() def redraw(self): - did = self.parent.deckChooser.selectedId() if self.addMode else None + did = None + if hasattr(self.parent,"deckChooser"): + did = self.parent.deckChooser.selectedId() self.cards = self.col.previewCards(self.note, 2, did = did) idx = self.ord if idx >= len(self.cards):