Browse Source

style(cli): minor fix

bergquist 9 years ago
parent
commit
5d821d3492
1 changed files with 4 additions and 2 deletions
  1. 4 2
      pkg/cmd/grafana-cli/commands/reset_password_command.go

+ 4 - 2
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,
 	}