mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 20:29:54 -06:00
graph/education: Remove unreachable code
An LDAP Modify operation never returns LDAPResultEntryAlreadyExists errors. That error can only happen for LDAPAdd or LDAPModifyDN.
This commit is contained in:
committed by
Ralf Haferkamp
parent
16debe6fa5
commit
ce808eaa17
@@ -253,13 +253,7 @@ func (i *LDAP) updateSchoolProperties(ctx context.Context, dn string, currentSch
|
||||
}
|
||||
|
||||
if err := i.conn.Modify(mr); err != nil {
|
||||
var lerr *ldap.Error
|
||||
logger.Debug().Err(err).Msg("error updating school number")
|
||||
if errors.As(err, &lerr) {
|
||||
if lerr.ResultCode == ldap.LDAPResultEntryAlreadyExists {
|
||||
err = errorcode.New(errorcode.NameAlreadyExists, lerr.Error())
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user