diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/controllers/registrations_controller.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r-- | app/controllers/registrations_controller.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index cc985e84542..fe800de5dd8 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -21,9 +21,10 @@ class RegistrationsController < Devise::RegistrationsController def create set_user_state - accept_pending_invitations super do |new_user| + accept_pending_invitations if new_user.persisted? + persist_accepted_terms_if_required(new_user) set_role_required(new_user) @@ -146,8 +147,12 @@ class RegistrationsController < Devise::RegistrationsController resource.persisted? && resource.blocked_pending_approval? end + def sign_up_params_attributes + [:username, :email, :name, :first_name, :last_name, :password] + end + def sign_up_params - params.require(:user).permit(:username, :email, :name, :first_name, :last_name, :password) + params.require(:user).permit(sign_up_params_attributes) end def resource_name @@ -201,6 +206,7 @@ class RegistrationsController < Devise::RegistrationsController experiment_name = session.delete(:invite_email_experiment_name) experiment(:invite_email_preview_text, actor: member).track(:accepted) if experiment_name == 'invite_email_preview_text' + experiment(:invite_email_from, actor: member).track(:accepted) if experiment_name == 'invite_email_from' Gitlab::Tracking.event(self.class.name, 'accepted', label: 'invite_email', property: member.id.to_s) end |