mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 23:27:12 -05:00
fix deck list/review screen due count mismatch by fixing .parents()
This commit is contained in:
parent
1c2b6b746f
commit
245d844616
1 changed files with 11 additions and 2 deletions
|
|
@ -331,8 +331,17 @@ class DeckManager(object):
|
|||
|
||||
def parents(self, did):
|
||||
"All parents of did."
|
||||
path = self.get(did)['name'].split("::")
|
||||
return [self.get(x) for x in path[:-1]]
|
||||
# get parent and grandparent names
|
||||
parents = []
|
||||
for part in self.get(did)['name'].split("::")[:-1]:
|
||||
if not parents:
|
||||
parents.append(part)
|
||||
else:
|
||||
parents.append(parents[-1] + "::" + part)
|
||||
# convert to objects
|
||||
for c, p in enumerate(parents):
|
||||
parents[c] = self.get(self.id(p))
|
||||
return parents
|
||||
|
||||
# Sync handling
|
||||
##########################################################################
|
||||
|
|
|
|||
Loading…
Reference in a new issue