summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/internal.rb2
-rw-r--r--lib/api/users.rb4
-rw-r--r--lib/gitlab/ldap/access.rb3
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index 479ee16a611..8606ff75e11 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -133,7 +133,7 @@ module API
end
codes = user.generate_otp_backup_codes!
- user.save!
+ ::Users::UpdateService.new(user, user).execute!
{ success: true, recovery_codes: codes }
end
diff --git a/lib/api/users.rb b/lib/api/users.rb
index ba59818ba84..2c632c85243 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -278,7 +278,7 @@ module API
email.destroy
- Users::UpdateService.new(current_user, user).execute do |user|
+ ::Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
end
end
@@ -511,7 +511,7 @@ module API
not_found!('Email') unless email
email.destroy
- Users::UpdateService.new(current_user, user).execute do |user|
+ ::Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
end
end
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb
index 54a5b1d31cd..7430db828a3 100644
--- a/lib/gitlab/ldap/access.rb
+++ b/lib/gitlab/ldap/access.rb
@@ -17,7 +17,8 @@ module Gitlab
self.open(user) do |access|
if access.allowed?
user.last_credential_check_at = Time.now
- user.save
+ Users::UpdateService.new(user, user).execute
+
true
else
false