Skip to content
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
2 changes: 1 addition & 1 deletion app/forms/gpo_verify_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def submit
result = valid?
threatmetrix_check_failed = fraud_review_checker.fraud_check_failed?
if result
pending_profile&.remove_gpo_deactivation_reason
if pending_in_person_enrollment?
UspsInPersonProofing::EnrollmentHelper.schedule_in_person_enrollment(user, pii)
pending_profile&.deactivate(:in_person_verification_pending)
elsif fraud_review_checker.fraud_check_failed? && threatmetrix_enabled?
pending_profile&.remove_gpo_deactivation_reason
deactivate_for_fraud_review
else
pending_profile&.update!(
Expand Down
11 changes: 11 additions & 0 deletions lib/tasks/fix_in_person_pending_user.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace :profiles do
desc 'If a profile is pending in-person and pending GPO remove the GPO pending status'
task fix_in_person_and_gpo_pending_user: :environment do
enrollments = InPersonEnrollment.pending.joins(:profile).where(
'profiles.gpo_verification_pending_at IS NOT NULL',
)
enrollments.each do |enrollment|
enrollment.profile.update!(gpo_verification_pending_at: nil)
end
end
end
1 change: 1 addition & 0 deletions spec/forms/gpo_verify_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@

expect(pending_profile).not_to be_active
expect(pending_profile.deactivation_reason).to eq('in_person_verification_pending')
expect(pending_profile.gpo_verification_pending?).to eq(false)
end

it 'updates establishing in-person enrollment to pending' do
Expand Down