From 4925b52a0e1dd9c345fbe144aaaf9eb7dd0ca73b Mon Sep 17 00:00:00 2001 From: Adphi Date: Fri, 18 Jan 2019 11:25:14 +0100 Subject: [PATCH] Fix User Update fields filter --- users.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/users.go b/users.go index d7a69ac..80c76a7 100644 --- a/users.go +++ b/users.go @@ -194,6 +194,10 @@ func (u *Users) Update(user *types.UserDetails) error { errs := make(chan types.UpdateError) var wg sync.WaitGroup for k := range m { + // Filter updatable fields + if ignoredUserField(k) { + continue + } var value string // Quota is a special case if k == "Quota" { @@ -206,7 +210,7 @@ func (u *Users) Update(user *types.UserDetails) error { } else { value = m[k].(string) } - if !ignoredUserField(k) && value != "" { + if value != "" { wg.Add(1) // All other non ignored values are strings go func(key string, value string) {