From bb2597b71236540de4685d3abb7fd6372d2a535b Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Thu, 27 Feb 2020 13:46:42 +0100 Subject: [PATCH] Load current settings before cli user ops --- system/commands/users.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/commands/users.go b/system/commands/users.go index 653591bc4..9dc70a59c 100644 --- a/system/commands/users.go +++ b/system/commands/users.go @@ -107,6 +107,9 @@ func Users() *cobra.Command { password []byte ) + // Update current settings to be sure that we do not have outdated values + cli.HandleError(service.DefaultSettings.UpdateCurrent(ctx)) + if existing, _ := userRepo.FindByEmail(user.Email); existing != nil && existing.ID > 0 { cmd.Printf("User already exists [%d].\n", existing.ID) return @@ -159,6 +162,9 @@ func Users() *cobra.Command { password []byte ) + // Update current settings to be sure that we do not have outdated values + cli.HandleError(service.DefaultSettings.UpdateCurrent(ctx)) + if user, err = userRepo.FindByEmail(args[0]); err != nil { cli.HandleError(err) }