Skip to content

Commit ad5246d

Browse files
committed
rotate command to read fields section
1 parent 9a200a2 commit ad5246d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

keepercommander/commands/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import csv
1616
import datetime
1717
import io
18+
import itertools
1819
import json
1920
import logging
2021
import os
@@ -675,7 +676,7 @@ def get_custom_field(record, field_name): # type: (vault.KeeperRecord, str)
675676
return next((x.value for x in record.custom if field_name.lower() == x.name.lower()), None)
676677

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

681682
@staticmethod

keepercommander/commands/record_edit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ def execute(self, params, **kwargs):
774774

775775
record_management.add_record_to_folder(params, record, folder_uid)
776776
params.sync_data = True
777+
params.environment_variables[LAST_RECORD_UID] = record.record_uid
777778
if expiration_period is not None:
778779
record_uid = record.record_uid
779780
record_key = record.record_key
@@ -789,7 +790,6 @@ def execute(self, params, **kwargs):
789790
url = urlunparse(('https', params.server, '/vault/share', None, None, utils.base64_url_encode(client_key)))
790791
return url
791792
else:
792-
params.environment_variables[LAST_RECORD_UID] = record.record_uid
793793
BreachWatch.scan_and_update_security_data(params, record.record_uid, params.breach_watch)
794794
return record.record_uid
795795

0 commit comments

Comments
 (0)