mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 14:29:40 +02:00
16 lines
349 B
Go
16 lines
349 B
Go
package fdo
|
|
|
|
func (handler *Handler) checkUniqueProfileName(name string, id int) (bool, error) {
|
|
profiles, err := handler.DataStore.FDOProfile().ReadAll()
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
|
|
for _, profile := range profiles {
|
|
if profile.Name == name && (id == -1 || id != int(profile.ID)) {
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
return true, nil
|
|
}
|