forked from demarches-simplifiees/demarches-simplifiees.fr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request demarches-simplifiees#9887 from mfo/US/fix-fci-mis…
…sing-device-callback Correctif: ETQ usager invité, lorsque je crée mon compte via FC, je ne retrouve pas mes invitations
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
22 changes: 22 additions & 0 deletions
22
lib/tasks/deployment/20231226140149_backfill_invites_missing_existing_user.rake
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace :after_party do | ||
desc 'Deployment task: backfill_invites_missing_existing_user' | ||
task backfill_invites_missing_existing_user: :environment do | ||
puts "Running deploy task 'backfill_invites_missing_existing_user'" | ||
|
||
# Put your task implementation HERE. | ||
Invite.where.missing(:user).in_batches do |invites_with_missing_user| | ||
linkable_users_and_invite = User.where(email: invites_with_missing_user.pluck(:email)) | ||
linkable_users_and_invite.each do |linkable_user_and_invite| | ||
begin | ||
linkable_user_and_invite.after_confirmation # calls link_invites! | ||
rescue err | ||
Sentry.capture_exception(err) | ||
end | ||
end | ||
end | ||
# Update task as completed. If you remove the line below, the task will | ||
# run with every deploy (or every time you call after_party:run). | ||
AfterParty::TaskRecord | ||
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp | ||
end | ||
end |
This file contains 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