diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/controllers/registrations_controller.rb | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r-- | app/controllers/registrations_controller.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 0800d635d92..ed0e019d02b 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -115,6 +115,7 @@ class RegistrationsController < Devise::RegistrationsController def after_request_hook(user) return unless user.persisted? + track_creation user: user Gitlab::Tracking.event(self.class.name, 'successfully_submitted_form', user: user) end @@ -145,6 +146,11 @@ class RegistrationsController < Devise::RegistrationsController users_sign_up_welcome_path(glm_tracking_params) end + def track_creation(user:) + label = user_invited? ? 'invited' : 'signup' + Gitlab::Tracking.event(self.class.name, 'create_user', label: label, user: user) + end + def ensure_destroy_prerequisites_met if current_user.solo_owned_groups.present? redirect_to profile_account_path, @@ -252,9 +258,15 @@ class RegistrationsController < Devise::RegistrationsController end end - def after_pending_invitations_hook - member_id = session.delete(:originating_member_id) + def user_invited? + !!member_id + end + def member_id + @member_id ||= session.delete(:originating_member_id) + end + + def after_pending_invitations_hook return unless member_id # if invited multiple times to different projects, only the email clicked will be counted as accepted |