Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More updates to account removing/restoring a registration #1961

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading