diff --git a/ppr-api/src/ppr_api/models/registration_utils.py b/ppr-api/src/ppr_api/models/registration_utils.py index c3216b7be..74f007578 100644 --- a/ppr-api/src/ppr_api/models/registration_utils.py +++ b/ppr-api/src/ppr_api/models/registration_utils.py @@ -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: @@ -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': diff --git a/ppr-api/src/ppr_api/resources/v1/financing_statements.py b/ppr-api/src/ppr_api/resources/v1/financing_statements.py index 6a0074243..8184f0efd 100644 --- a/ppr-api/src/ppr_api/resources/v1/financing_statements.py +++ b/ppr-api/src/ppr_api/resources/v1/financing_statements.py @@ -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']