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

[CPDNPQ-2128] Keep the user TRN unchanged when TRA returns an empty TRN #1782

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leoapost
Copy link
Contributor

@leoapost leoapost commented Oct 4, 2024

Context

Ticket: https://dfedigital.atlassian.net/browse/CPDNPQ-000

Our code is currently overriding the user's data with their TRA record. When a user's TRN doesn't match a TRA record, we allow them to submit their application with the TRN they provided. However, this leads to the TRN being overwritten with a blank value.

We need to ensure the TRN is retained in such cases.

Changes proposed in this pull request

Modify the User methods find_or_create_from_tra_data_on_unclaimed_email and find_or_create_from_tra_data_on_uid to update the TRN only when a TRN is returned by TRA.

Going forward, we need to ensure that we only update the TRN in NPQ app
if there is a change in the TRN recorded by DfE Identity. We never want
the TRN field to be nil.
Copy link

github-actions bot commented Oct 4, 2024

Copy link

sonarcloud bot commented Oct 4, 2024

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.

1 participant