Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 09:09:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 09:09:03 +0300
commit10213bf3b26c3c21f7683471d35d1cd052c41e9c (patch)
tree32d1c776e16f56e1fc7a2ad0d5550029c24a3473 /app/services/users
parentc60a1173018e93e6bf433f87cb726adc979d1c8a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/users')
-rw-r--r--app/services/users/create_service.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/services/users/create_service.rb b/app/services/users/create_service.rb
index 2ac6dfd90fa..ec8b3cea664 100644
--- a/app/services/users/create_service.rb
+++ b/app/services/users/create_service.rb
@@ -11,12 +11,19 @@ module Users
def execute(skip_authorization: false)
user = Users::BuildService.new(current_user, params).execute(skip_authorization: skip_authorization)
+ reset_token = user.generate_reset_token if user.recently_sent_password_reset?
- @reset_token = user.generate_reset_token if user.recently_sent_password_reset?
-
- notify_new_user(user, @reset_token) if user.save
+ after_create_hook(user, reset_token) if user.save
user
end
+
+ private
+
+ def after_create_hook(user, reset_token)
+ notify_new_user(user, reset_token)
+ end
end
end
+
+Users::CreateService.prepend_if_ee('EE::Users::CreateService')