Skip to content

Commit

Permalink
Hide protected custom properties
Browse files Browse the repository at this point in the history
  • Loading branch information
vaygr authored and firecat53 committed Aug 9, 2023
1 parent 14b2782 commit 96593ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion keepmenu/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ def view_entry(kp_entry):
for attr in attrs:
if attr not in TOTP_FIELDS:
val = attrs.get(attr) or ""
value = val or "None" if len(val.split('\n')) <= 1 else "<Enter to view>"
protected = kp_entry.is_custom_property_protected(attr) if \
hasattr(kp_entry, 'is_custom_property_protected') \
else False
value = val or "None" if len(val.split('\n')) <= 1 and \
not protected \
else "<Enter to view>"
fields.append(f'{attr}: {value}')

sel = dmenu_select(len(fields), inp="\n".join(fields))
Expand Down
Binary file modified tests/test.kdbx
Binary file not shown.

0 comments on commit 96593ec

Please sign in to comment.