summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-05 14:53:41 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-05 14:53:41 -0600
commit4e8c59279c235fef021f01ca67a05869ab54d1aa (patch)
treed01b766390b42d58f439002b79ae4e55f7ac3e1a /store
parent9ddf26f6fb1a947c6e473c925423775f948453e4 (diff)
downloadchat-4e8c59279c235fef021f01ca67a05869ab54d1aa.tar.gz
chat-4e8c59279c235fef021f01ca67a05869ab54d1aa.tar.bz2
chat-4e8c59279c235fef021f01ca67a05869ab54d1aa.zip
Moving to constnt
Diffstat (limited to 'store')
-rw-r--r--store/sql_user_store.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index e296b852b..32332ad92 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -10,6 +10,10 @@ import (
"strings"
)
+const (
+ MISSING_ACCOUNT_ERROR = "We couldn't find an existing account matching your email address for this team. This team may require an invite from the team owner to join."
+)
+
type SqlUserStore struct {
*SqlStore
}
@@ -330,7 +334,7 @@ func (us SqlUserStore) Get(id string) StoreChannel {
if obj, err := us.GetReplica().Get(model.User{}, id); err != nil {
result.Err = model.NewAppError("SqlUserStore.Get", "We encountered an error finding the account", "user_id="+id+", "+err.Error())
} else if obj == nil {
- result.Err = model.NewAppError("SqlUserStore.Get", "We couldn't find an existing account matching your email address for this team. This team may require an invite from the team owner to join.", "user_id="+id)
+ result.Err = model.NewAppError("SqlUserStore.Get", MISSING_ACCOUNT_ERROR, "user_id="+id)
} else {
result.Data = obj.(*model.User)
}
@@ -435,7 +439,7 @@ func (us SqlUserStore) GetByEmail(teamId string, email string) StoreChannel {
user := model.User{}
if err := us.GetReplica().SelectOne(&user, "SELECT * FROM Users WHERE TeamId = :TeamId AND Email = :Email", map[string]interface{}{"TeamId": teamId, "Email": email}); err != nil {
- result.Err = model.NewAppError("SqlUserStore.GetByEmail", "We couldn't find an existing account matching your email address for this team. This team may require an invite from the team owner to join.", "teamId="+teamId+", email="+email+", "+err.Error())
+ result.Err = model.NewAppError("SqlUserStore.GetByEmail", MISSING_ACCOUNT_ERROR, "teamId="+teamId+", email="+email+", "+err.Error())
}
result.Data = &user