Skip to content

Commit

Permalink
Handle double user bootcamp datas (#7268)
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD authored Jan 9, 2025
1 parent 7478efb commit d70e6cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/bootcamp_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ def stripe_session_status
else
user = User.find_by(email: @bootcamp_data.email)
if user
# Reset old bootcamp data sessions
User::BootcampData.where(user:).
where.not(id: @bootcamp_data.id).
update_all(user_id: nil)

# Enroll this one.
@bootcamp_data.update(user:)
User::BecomeBootcampAttendee.(user)
end
Expand Down

0 comments on commit d70e6cb

Please sign in to comment.