mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 07:37:11 -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):
|
def parents(self, did):
|
||||||
"All parents of did."
|
"All parents of did."
|
||||||
path = self.get(did)['name'].split("::")
|
# get parent and grandparent names
|
||||||
return [self.get(x) for x in path[:-1]]
|
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
|
# Sync handling
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue