Skip to content

Commit

Permalink
make sure we normalize deck names on input
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Dec 24, 2018
1 parent 1c39f4c commit 71e0c88
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions anki/decks.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def flush(self):
def id(self, name, create=True, type=defaultDeck):
"Add a deck with NAME. Reuse deck if already exists. Return id as int."
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)
Expand Down

0 comments on commit 71e0c88

Please sign in to comment.