Correcting a small bug

I though «addMode» meant «call from addcard window». Instead, to know
whether parent is addcard, I check whether it has attribute deckChooser
This commit is contained in:
Arthur-Milchior 2019-02-17 19:26:31 +01:00
parent 20ff61e59e
commit 6532023c3e

View File

@ -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):