Skip to content

Commit

Permalink
rotate command to read fields section
Browse files Browse the repository at this point in the history
  • Loading branch information
sk-keeper committed Jan 31, 2025
1 parent 9a200a2 commit ad5246d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion keepercommander/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import csv
import datetime
import io
import itertools
import json
import logging
import os
Expand Down Expand Up @@ -675,7 +676,7 @@ def get_custom_field(record, field_name): # type: (vault.KeeperRecord, str)
return next((x.value for x in record.custom if field_name.lower() == x.name.lower()), None)

if isinstance(record, vault.TypedRecord):
return next((x.get_default_value(str) for x in record.custom
return next((x.get_default_value(str) for x in itertools.chain(record.fields, record.custom)
if (x.type or 'text') in RecordMixin.CUSTOM_FIELD_TYPES and field_name.lower() == (x.label or '').lower()), None)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion keepercommander/commands/record_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ def execute(self, params, **kwargs):

record_management.add_record_to_folder(params, record, folder_uid)
params.sync_data = True
params.environment_variables[LAST_RECORD_UID] = record.record_uid
if expiration_period is not None:
record_uid = record.record_uid
record_key = record.record_key
Expand All @@ -789,7 +790,6 @@ def execute(self, params, **kwargs):
url = urlunparse(('https', params.server, '/vault/share', None, None, utils.base64_url_encode(client_key)))
return url
else:
params.environment_variables[LAST_RECORD_UID] = record.record_uid
BreachWatch.scan_and_update_security_data(params, record.record_uid, params.breach_watch)
return record.record_uid

Expand Down

0 comments on commit ad5246d

Please sign in to comment.