diff --git a/awx/sso/conf.py b/awx/sso/conf.py index 65513e7882..504b7724d4 100644 --- a/awx/sso/conf.py +++ b/awx/sso/conf.py @@ -306,7 +306,6 @@ def _register_ldap(append=None): category=_('LDAP'), category_slug='ldap', default=collections.OrderedDict([ - #('member_attr', 'member'), ('name_attr', 'cn'), ]), placeholder=collections.OrderedDict([ diff --git a/awx/sso/fields.py b/awx/sso/fields.py index 997a311823..fbc6ee75d4 100644 --- a/awx/sso/fields.py +++ b/awx/sso/fields.py @@ -369,6 +369,10 @@ class LDAPGroupTypeField(fields.ChoiceField): # MemberDNGroupType was the only group type, of the underlying lib, that # took a parameter. params_sanitized = dict() + if isinstance(cls, LDAPGroupType): + if 'name_attr' in params: + params_sanitized['name_attr'] = params['name_attr'] + if data.endswith('MemberDNGroupType'): params.setdefault('member_attr', 'member') params_sanitized['member_attr'] = params['member_attr'] diff --git a/awx/sso/ldap_group_types.py b/awx/sso/ldap_group_types.py index 4f8402eaa7..c898cf28f8 100644 --- a/awx/sso/ldap_group_types.py +++ b/awx/sso/ldap_group_types.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Ansible by Red Hat +# Copyright (c) 2018 Ansible by Red Hat # All Rights Reserved. # Python