Fix User Update fields filter

This commit is contained in:
Adphi 2019-01-18 11:25:14 +01:00
parent 014ac7ff7e
commit 4925b52a0e

View File

@ -194,6 +194,10 @@ func (u *Users) Update(user *types.UserDetails) error {
errs := make(chan types.UpdateError) errs := make(chan types.UpdateError)
var wg sync.WaitGroup var wg sync.WaitGroup
for k := range m { for k := range m {
// Filter updatable fields
if ignoredUserField(k) {
continue
}
var value string var value string
// Quota is a special case // Quota is a special case
if k == "Quota" { if k == "Quota" {
@ -206,7 +210,7 @@ func (u *Users) Update(user *types.UserDetails) error {
} else { } else {
value = m[k].(string) value = m[k].(string)
} }
if !ignoredUserField(k) && value != "" { if value != "" {
wg.Add(1) wg.Add(1)
// All other non ignored values are strings // All other non ignored values are strings
go func(key string, value string) { go func(key string, value string) {