From ed879df1f461b4bc2c67347754bd407f9160fc76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 16 Jan 2015 16:17:35 +0100 Subject: [PATCH] Corrected spelling of SignedInUser (was SignInUser) --- pkg/middleware/middleware.go | 12 ++++++------ pkg/models/account.go | 4 ++-- pkg/services/sqlstore/accounts.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/middleware/middleware.go b/pkg/middleware/middleware.go index 77ade01f75c..431883e69a0 100644 --- a/pkg/middleware/middleware.go +++ b/pkg/middleware/middleware.go @@ -16,7 +16,7 @@ import ( type Context struct { *macaron.Context - *m.SignInUser + *m.SignedInUser Session session.Store @@ -37,7 +37,7 @@ func GetContextHandler() macaron.Handler { log.Error(3, "Failed to get user by id, %v, %v", accountId, err) } else { ctx.IsSignedIn = true - ctx.SignInUser = query.Result + ctx.SignedInUser = query.Result } } else if token := getApiToken(ctx); token != "" { // Try API Key auth @@ -54,12 +54,12 @@ func GetContextHandler() macaron.Handler { } ctx.IsSignedIn = true - ctx.SignInUser = query.Result + ctx.SignedInUser = query.Result // api key role - ctx.SignInUser.UserRole = tokenInfo.Role - ctx.SignInUser.UsingAccountId = ctx.SignInUser.AccountId - ctx.SignInUser.UsingAccountName = ctx.SignInUser.UserName + ctx.UserRole = tokenInfo.Role + ctx.UsingAccountId = ctx.AccountId + ctx.UsingAccountName = ctx.UserName } } diff --git a/pkg/models/account.go b/pkg/models/account.go index 40c5b54e281..5aaf0d38639 100644 --- a/pkg/models/account.go +++ b/pkg/models/account.go @@ -87,12 +87,12 @@ type SearchAccountsQuery struct { type GetSignedInUserQuery struct { AccountId int64 - Result *SignInUser + Result *SignedInUser } // ------------------------ // DTO & Projections -type SignInUser struct { +type SignedInUser struct { AccountId int64 UsingAccountId int64 UsingAccountName string diff --git a/pkg/services/sqlstore/accounts.go b/pkg/services/sqlstore/accounts.go index ca478a7e161..3a1f2ca7982 100644 --- a/pkg/services/sqlstore/accounts.go +++ b/pkg/services/sqlstore/accounts.go @@ -174,7 +174,7 @@ func GetSignedInUser(query *m.GetSignedInUserQuery) error { LEFT OUTER JOIN collaborator on collaborator.account_id = usingAccount.id AND collaborator.collaborator_id = userAccount.id WHERE userAccount.id=?` - var user m.SignInUser + var user m.SignedInUser sess := x.Table("account") has, err := sess.Sql(rawSql, query.AccountId).Get(&user) if err != nil {