Skip to content

Commit

Permalink
More updates to account removing/restoring a registration (#1961)
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Jul 4, 2024
1 parent 53b62ca commit 0d2b53c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ppr-api/src/ppr_api/models/registration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def can_access_report(account_id: str, account_name: str, reg_json, sbc_staff: b
reg_account_id = reg_json['accountId']
if is_all_staff_account(account_id) or sbc_staff:
return True
if account_id == reg_account_id:
if reg_account_id in (account_id, account_id + '_R'):
return True
if account_name:
if reg_json['registeringParty'] == account_name:
Expand All @@ -157,7 +157,7 @@ def update_summary_optional(reg_json, account_id: str, sbc_staff: bool = False):
reg_json['registeringName'] = ''
# Only staff role or matching account includes registeringName
elif not is_all_staff_account(account_id) and not sbc_staff and 'accountId' in reg_json and \
account_id != reg_json['accountId']:
reg_json['accountId'] not in (account_id, account_id + '_R'):
reg_json['registeringName'] = ''

if not reg_json['clientReferenceId'] or reg_json['clientReferenceId'].lower() == 'none':
Expand Down
2 changes: 1 addition & 1 deletion ppr-api/src/ppr_api/resources/v1/financing_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def post_account_registrations(registration_num: str):
registration['registrationClass'] in (model_utils.REG_CLASS_CROWN, model_utils.REG_CLASS_MISC) and \
not AccountBcolId.crown_charge_account(account_id):
return resource_utils.cc_forbidden_error_response(account_id)
if registration['accountId'] != account_id:
if registration['accountId'] not in (account_id, account_id + '_R'):
extra_registration = UserExtraRegistration(account_id=account_id, registration_number=base_reg_num)
extra_registration.save()
del registration['accountId']
Expand Down

0 comments on commit 0d2b53c

Please sign in to comment.