Don't send GPO reminders to users with active profiles#10502
Merged
Conversation
Ensure the user doesn't have an active profile before we try to send them a reminder email. changelog: Bug Fixes, Identity verification, Don't send GPO reminder emails to users with active profiles
matthinz
commented
Apr 24, 2024
| reminder_eligible_range = | ||
| IdentityConfig.store.usps_confirmation_max_days.days.ago..for_letters_sent_before | ||
| profiles_due_for_reminder(for_letters_sent_before).each do |profile| | ||
| next if profile.user.active_profile |
Contributor
Author
There was a problem hiding this comment.
I spent a few minutes trying to adjust the ActiveRecord query to just find profiles for users that don't have an active profile, but gave up and went with this. The numbers are pretty small in production, so there's not too much associated waste with doing this filtering in Ruby code rather than in SQL.
zachmargolis
approved these changes
Apr 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎫 Ticket
Link to the relevant ticket:
LG-13167
🛠 Summary of changes
Fixes an issue in production where we get a NoMethodError when sending GPO reminder emails because we currently have a user with both a GPO pending profile and an active profile.