Skip to content

Commit

Permalink
record-type: fixed custom record-type validation bug preventing del…
Browse files Browse the repository at this point in the history
…ete/update via command (KC-743)
  • Loading branch information
aaunario-keeper committed Apr 1, 2024
1 parent 8d44e60 commit 86163a5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions keepercommander/commands/recordv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,14 @@ def execute(self, params, **kwargs):
logging.error(f'record type \'{action}\': please provide the record type ID')
return

if 1000 < rtid < 1000000:
real_type_id = rtid - 1000
else:
num_rts_per_scope = 1000000
enterprise_rt_id_min = num_rts_per_scope * records.RT_ENTERPRISE
enterprise_rt_id_max = enterprise_rt_id_min + num_rts_per_scope
is_enterprise_rt = enterprise_rt_id_min < rtid <= enterprise_rt_id_max
real_type_id = rtid % num_rts_per_scope
is_custom_rt = real_type_id > 1000

if not is_enterprise_rt or not is_custom_rt:
logging.error('Only custom record types can be modified or removed')
return

Expand Down

0 comments on commit 86163a5

Please sign in to comment.