From 4761f4454c0631b7ebefc85b20a7d2bbad9b46cb Mon Sep 17 00:00:00 2001 From: Michael de Sa Date: Thu, 12 Oct 2017 17:56:25 -0400 Subject: [PATCH] Set ID on retrieved user from boltdb Signed-off-by: Jared Scheib --- bolt/internal/internal.go | 1 + bolt/users.go | 1 + 2 files changed, 2 insertions(+) diff --git a/bolt/internal/internal.go b/bolt/internal/internal.go index f031da48a..01c65e0a2 100644 --- a/bolt/internal/internal.go +++ b/bolt/internal/internal.go @@ -414,6 +414,7 @@ func MarshalUser(u *chronograf.User) ([]byte, error) { roles[i] = role.Name } return MarshalUserPB(&User{ + ID: u.ID, Name: u.Name, Provider: u.Provider, Scheme: u.Scheme, diff --git a/bolt/users.go b/bolt/users.go index 0754860aa..5eb9b05b2 100644 --- a/bolt/users.go +++ b/bolt/users.go @@ -69,6 +69,7 @@ func (s *UsersStore) Add(ctx context.Context, u *chronograf.User) (*chronograf.U if err != nil { return err } + u.ID = seq if v, err := internal.MarshalUser(u); err != nil { return err } else if err := b.Put(u64tob(seq), v); err != nil {