3
0

Load current settings before cli user ops

This commit is contained in:
Denis Arh 2020-02-27 13:46:42 +01:00
parent ca78df21f0
commit bb2597b712

View File

@ -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)
}