Skip to content

32792 - Add Validation for Custodian First Name in VD#4350

Merged
meawong merged 2 commits intobcgov:mainfrom
meawong:32792-Add-Validation-for-VD-Custodian-First-Name
May 4, 2026
Merged

32792 - Add Validation for Custodian First Name in VD#4350
meawong merged 2 commits intobcgov:mainfrom
meawong:32792-Add-Validation-for-VD-Custodian-First-Name

Conversation

@meawong
Copy link
Copy Markdown
Collaborator

@meawong meawong commented Apr 30, 2026

Issue #: /bcgov/entity#32792

Description of changes:

  • Refactor existing validate_custodian_org_name and add logic for VD party first name validation
  • Update unit tests

Examples:
image
image
image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).

@meawong meawong self-assigned this Apr 30, 2026
@meawong meawong requested review from kialj876 and loneil April 30, 2026 23:50
Copy link
Copy Markdown
Collaborator

@kialj876 kialj876 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, lgtm


else:
first_name = get_str(party, "/officer/firstName")
stripped_first_name = first_name.strip()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried quick locally on this branch and Llooks like can get through to this point without providing firstName at all so this excepts with AttributeError: 'NoneType' object has no attribute 'strip' and falls back with the generic handler.
Something like
if first_name is None or not first_name.strip(): could handle that

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated:
image

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 2026

@meawong meawong merged commit c54e09b into bcgov:main May 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants