mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Revert "DeckManager: _checkDeckTree ignore case"
This reverts commit 9955048aec
.
This commit broke collections that had children under each of the
the duplicate names - it renames one of the decks, but the children
of the renamed deck are left without a parent, causing an error like
line 235, in deckDueList nlim = min(nlim, lims[p][0])\n\nKeyError('..)
Rather than a more complicated approach, I think it's safer just to
leave the case or normalization-differing decks around for now, and
we can normalize things properly in a future schema upgrade.
This commit is contained in:
parent
66406110f5
commit
5418af00f7
1 changed files with 4 additions and 4 deletions
|
@ -459,7 +459,7 @@ class DeckManager:
|
|||
|
||||
for deck in decks:
|
||||
# two decks with the same name?
|
||||
if self.normalizeName(deck['name']) in names:
|
||||
if deck['name'] in names:
|
||||
self.col.log("fix duplicate deck name", deck['name'])
|
||||
deck['name'] += "%d" % intTime(1000)
|
||||
self.save(deck)
|
||||
|
@ -473,12 +473,12 @@ class DeckManager:
|
|||
# immediate parent must exist
|
||||
if "::" in deck['name']:
|
||||
immediateParent = "::".join(deck['name'].split("::")[:-1])
|
||||
if self.normalizeName(immediateParent) not in names:
|
||||
if immediateParent not in names:
|
||||
self.col.log("fix deck with missing parent", deck['name'])
|
||||
self._ensureParents(deck['name'])
|
||||
names.add(self.normalizeName(immediateParent))
|
||||
names.add(immediateParent)
|
||||
|
||||
names.add(self.normalizeName(deck['name']))
|
||||
names.add(deck['name'])
|
||||
|
||||
def checkIntegrity(self):
|
||||
self._recoverOrphans()
|
||||
|
|
Loading…
Reference in a new issue