From: Florian Forster Date: Wed, 10 Jan 2018 21:02:50 +0000 (+0100) Subject: Package app: Add email address to User object. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d7a4cd55f58dc548f6f037d59d5ce605824d3f67;p=kraftakt.git Package app: Add email address to User object. --- diff --git a/app/user.go b/app/user.go index 86c033c..8465c2c 100644 --- a/app/user.go +++ b/app/user.go @@ -11,7 +11,8 @@ import ( ) type User struct { - key *datastore.Key + Email string + key *datastore.Key } type dbUser struct { @@ -35,7 +36,8 @@ func NewUser(ctx context.Context, email string) (*User, error) { } return &User{ - key: datastore.NewKey(ctx, "User", email, 0, nil), + Email: email, + key: datastore.NewKey(ctx, "User", email, 0, nil), }, nil } @@ -50,7 +52,8 @@ func UserByID(ctx context.Context, id string) (*User, error) { } return &User{ - key: keys[0], + Email: keys[0].StringID(), + key: keys[0], }, nil } diff --git a/gfitsync.go b/gfitsync.go index 0007395..898fb98 100644 --- a/gfitsync.go +++ b/gfitsync.go @@ -200,6 +200,6 @@ func handleNotification(ctx context.Context, s *fitbit.Subscription) error { return err } - log.Debugf(ctx, "ActivitySummary(%q) = %+v", s.OwnerID, summary) + log.Debugf(ctx, "ActivitySummary for %s = %+v", u.Email, summary) return nil }