From 5d821d349271774521e2b242bb2dd405127c1d12 Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 24 Aug 2016 20:27:41 +0200 Subject: [PATCH] style(cli): minor fix --- pkg/cmd/grafana-cli/commands/reset_password_command.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/grafana-cli/commands/reset_password_command.go b/pkg/cmd/grafana-cli/commands/reset_password_command.go index dac43aa7aba..febabd2055b 100644 --- a/pkg/cmd/grafana-cli/commands/reset_password_command.go +++ b/pkg/cmd/grafana-cli/commands/reset_password_command.go @@ -10,6 +10,8 @@ import ( "github.com/grafana/grafana/pkg/util" ) +const AdminUserId = 1 + func resetPasswordCommand(c CommandLine) error { newPassword := c.Args().First() @@ -17,7 +19,7 @@ func resetPasswordCommand(c CommandLine) error { return fmt.Errorf("New password too short") } - userQuery := models.GetUserByIdQuery{Id: 1} + userQuery := models.GetUserByIdQuery{Id: AdminUserId} if err := bus.Dispatch(&userQuery); err != nil { return fmt.Errorf("Could not read user from database. Error: %v", err) @@ -26,7 +28,7 @@ func resetPasswordCommand(c CommandLine) error { passwordHashed := util.EncodePassword(newPassword, userQuery.Result.Salt) cmd := models.ChangeUserPasswordCommand{ - UserId: 1, + UserId: AdminUserId, NewPassword: passwordHashed, }