Skip to content

Commit

Permalink
Fix KDB export group creation
Browse files Browse the repository at this point in the history
This fixes a silly variable change in commit d9dc79d.
It also fixes the path segments search and creation.
  • Loading branch information
cbosdo committed Aug 15, 2022
1 parent d9dc79d commit ab7ac18
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pass_import/formats/kdbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ def insert(self, entry):
group = os.path.dirname(path)

root_group = self.keepass.root_group
kpgroup = self.keepass.find_groups(path=os.path.split(path))
kpgroup = self.keepass.find_groups(path=os.path.split(group))
if not kpgroup:
for grp in os.path.split(group):
kpgroup = self.keepass.find_groups(path=grp)
# os.path.split creates an empty segment when there is nothing to split, just ignore it
if grp == '':
continue
kpgroup = self.keepass.find_groups(group=root_group, name=grp, first=True)
if not kpgroup:
kpgroup = self.keepass.add_group(root_group, grp)
root_group = kpgroup
Expand Down

0 comments on commit ab7ac18

Please sign in to comment.