Merge pull request #5121 from stonezdj/fix_5096

If group already exist return 409 when adding a LDAP user group
This commit is contained in:
Daniel Jiang 2018-06-13 17:57:58 +08:00 committed by GitHub
commit 05c5cbc227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,7 @@ func (uga *UserGroupAPI) Post() {
} }
if len(result) > 0 { if len(result) > 0 {
uga.HandleConflict("Error occurred in add user group, duplicate user group exist.") uga.HandleConflict("Error occurred in add user group, duplicate user group exist.")
return
} }
// User can not add ldap group when the ldap server is offline // User can not add ldap group when the ldap server is offline
ldapGroup, err := auth.SearchGroup(userGroup.LdapGroupDN) ldapGroup, err := auth.SearchGroup(userGroup.LdapGroupDN)