fix: Group tree path
This commit is contained in:
parent
e310930d9e
commit
5224fe78b6
1 changed files with 2 additions and 10 deletions
|
|
@ -47,16 +47,8 @@ class PasswordsController:
|
|||
return e
|
||||
|
||||
def _node_of_group(self, g: Group) -> NodeDTO:
|
||||
def group_path(gr: Group) -> str:
|
||||
names: List[str] = []
|
||||
cur = gr
|
||||
while cur and cur.name:
|
||||
names.append(cur.name)
|
||||
cur = cur.parent
|
||||
names.reverse()
|
||||
return "/" + "/".join(names) if names else "/"
|
||||
|
||||
path = group_path(g)
|
||||
raw_path = g.path
|
||||
path = "/" + "/".join(raw_path) if raw_path else "/"
|
||||
groups = [self._node_of_group(sg) for sg in g.subgroups]
|
||||
entries = [EntryNodeDTO(
|
||||
kind=EntryKind.complex if (e.username or e.url or e.notes) else EntryKind.simple,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue