diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-23 22:32:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-23 22:32:01 +0300 |
commit | a9d8078fd8eae9d32ac463d1e0d1d08c19b579ce (patch) | |
tree | cb3f6846f03f6f8f8d0426410b920edd706f6f53 /app/models | |
parent | 711f0b7720142761f632a87e6f3e9eb24c3aed27 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-ee
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user_synced_attributes_metadata.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/app/models/user_synced_attributes_metadata.rb b/app/models/user_synced_attributes_metadata.rb index 4cceffda19e..4cd0e3fb828 100644 --- a/app/models/user_synced_attributes_metadata.rb +++ b/app/models/user_synced_attributes_metadata.rb @@ -27,15 +27,11 @@ class UserSyncedAttributesMetadata < ApplicationRecord class << self def syncable_attributes - return SYNCABLE_ATTRIBUTES if sync_name? - - SYNCABLE_ATTRIBUTES - %i[name] - end - - private - - def sync_name? - Gitlab.config.ldap.sync_name + if Gitlab.config.ldap.enabled && !Gitlab.config.ldap.sync_name + SYNCABLE_ATTRIBUTES - %i[name] + else + SYNCABLE_ATTRIBUTES + end end end |