summaryrefslogtreecommitdiffstats
path: root/api/import.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-01-20 13:36:16 -0600
committerCorey Hulen <corey@hulen.com>2016-01-20 13:36:16 -0600
commitaefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b (patch)
treed87809ff2a306e5428b0ab6973d05509baa21abd /api/import.go
parent0b1aff3b24b4ac2df8e963c83d6e52b127c603f9 (diff)
downloadchat-aefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b.tar.gz
chat-aefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b.tar.bz2
chat-aefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b.zip
Revert " PLT-7 adding loc for db calls"
Diffstat (limited to 'api/import.go')
-rw-r--r--api/import.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/api/import.go b/api/import.go
index e94e83e9a..5c8f99348 100644
--- a/api/import.go
+++ b/api/import.go
@@ -6,7 +6,6 @@ package api
import (
l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
- goi18n "github.com/nicksnyder/go-i18n/i18n"
)
//
@@ -14,28 +13,28 @@ import (
// some of the usual checks. (IsValid is still run)
//
-func ImportPost(T goi18n.TranslateFunc, post *model.Post) {
+func ImportPost(post *model.Post) {
post.Hashtags, _ = model.ParseHashtags(post.Message)
- if result := <-Srv.Store.Post().Save(T, post); result.Err != nil {
+ if result := <-Srv.Store.Post().Save(post); result.Err != nil {
l4g.Debug("Error saving post. user=" + post.UserId + ", message=" + post.Message)
}
}
-func ImportUser(T goi18n.TranslateFunc, user *model.User) *model.User {
+func ImportUser(user *model.User) *model.User {
user.MakeNonNil()
- if result := <-Srv.Store.User().Save(T, user); result.Err != nil {
+ if result := <-Srv.Store.User().Save(user); result.Err != nil {
l4g.Error("Error saving user. err=%v", result.Err)
return nil
} else {
ruser := result.Data.(*model.User)
- if err := JoinDefaultChannels(T, ruser, ""); err != nil {
+ if err := JoinDefaultChannels(ruser, ""); err != nil {
l4g.Error("Encountered an issue joining default channels user_id=%s, team_id=%s, err=%v", ruser.Id, ruser.TeamId, err)
}
- if cresult := <-Srv.Store.User().VerifyEmail(T, ruser.Id); cresult.Err != nil {
+ if cresult := <-Srv.Store.User().VerifyEmail(ruser.Id); cresult.Err != nil {
l4g.Error("Failed to set email verified err=%v", cresult.Err)
}
@@ -43,8 +42,8 @@ func ImportUser(T goi18n.TranslateFunc, user *model.User) *model.User {
}
}
-func ImportChannel(T goi18n.TranslateFunc, channel *model.Channel) *model.Channel {
- if result := <-Srv.Store.Channel().Save(T, channel); result.Err != nil {
+func ImportChannel(channel *model.Channel) *model.Channel {
+ if result := <-Srv.Store.Channel().Save(channel); result.Err != nil {
return nil
} else {
sc := result.Data.(*model.Channel)