DeckManager.id return existing deck ignoring case

This commit is contained in:
Arthur Milchior 2019-11-13 15:48:33 +01:00
parent 3afb28c05f
commit 31ccd31e97

View File

@ -135,9 +135,9 @@ class DeckManager:
type = defaultDeck
name = name.replace('"', '')
name = unicodedata.normalize("NFC", name)
for id, g in list(self.decks.items()):
if unicodedata.normalize("NFC", g['name'].lower()) == name.lower():
return int(id)
deck = self.byName(name)
if deck:
return int(deck["id"])
if not create:
return None
g = copy.deepcopy(type)