fix .select() not handling string arguments

This commit is contained in:
Damien Elmes 2021-03-26 11:27:49 +10:00
parent a16940a246
commit 8e0f00fbb9

View file

@ -448,7 +448,8 @@ class DeckManager:
def select(self, did: DeckID) -> None: def select(self, did: DeckID) -> None:
"Select a new branch." "Select a new branch."
# make sure arg is an int # make sure arg is an int; legacy callers may be passing in a string
did = DeckID(did)
current = self.selected() current = self.selected()
active = self.deck_and_child_ids(did) active = self.deck_and_child_ids(did)
if current != did or active != self.active(): if current != did or active != self.active():