Strip name of added deck

There is currently what I believe to be a bug: create a deck "   ".
The creation is accepted and the name is renamed to "blank". Instead,
I believe you'd want to strip the deck name before testing its
emptiness.
This commit is contained in:
Arthur Milchior 2020-06-17 11:58:33 +02:00
parent b51f03085e
commit 3eabe4c3f7

View File

@ -145,6 +145,7 @@ class StudyDeck(QDialog):
else: else:
default = self.names[self.form.list.currentRow()] default = self.names[self.form.list.currentRow()]
n = getOnlyText(_("New deck name:"), default=default) n = getOnlyText(_("New deck name:"), default=default)
n = n.strip()
if n: if n:
did = self.mw.col.decks.id(n) did = self.mw.col.decks.id(n)
# deck name may not be the same as user input. ex: ", :: # deck name may not be the same as user input. ex: ", ::