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:
Diffstat (limited to 'app/models/user_synced_attributes_metadata.rb')
-rw-r--r--app/models/user_synced_attributes_metadata.rb14
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