Fixing localization error in commands

Этот коммит содержится в:
Christopher Speller
2016-02-22 19:12:35 -05:00
родитель 51680a7cd8
Коммит 29c5bd9def

Просмотреть файл

@@ -276,9 +276,7 @@ func cmdCreateTeam() {
os.Exit(1)
}
c := &api.Context{}
c.RequestId = model.NewId()
c.IpAddress = "cmd_line"
c := getMockContext()
team := &model.Team{}
team.DisplayName = flagTeamName
@@ -377,9 +375,7 @@ func cmdAssignRole() {
os.Exit(1)
}
c := &api.Context{}
c.RequestId = model.NewId()
c.IpAddress = "cmd_line"
c := getMockContext()
var team *model.Team
if result := <-api.Srv.Store.Team().GetByName(flagTeamName); result.Err != nil {
@@ -431,10 +427,6 @@ func cmdResetPassword() {
os.Exit(1)
}
c := &api.Context{}
c.RequestId = model.NewId()
c.IpAddress = "cmd_line"
var team *model.Team
if result := <-api.Srv.Store.Team().GetByName(flagTeamName); result.Err != nil {
l4g.Error("%v", result.Err)
@@ -474,9 +466,7 @@ func cmdPermDeleteUser() {
os.Exit(1)
}
c := &api.Context{}
c.RequestId = model.NewId()
c.IpAddress = "cmd_line"
c := getMockContext()
var team *model.Team
if result := <-api.Srv.Store.Team().GetByName(flagTeamName); result.Err != nil {
@@ -525,9 +515,7 @@ func cmdPermDeleteTeam() {
os.Exit(1)
}
c := &api.Context{}
c.RequestId = model.NewId()
c.IpAddress = "cmd_line"
c := getMockContext()
var team *model.Team
if result := <-api.Srv.Store.Team().GetByName(flagTeamName); result.Err != nil {
@@ -566,6 +554,15 @@ func flushLogAndExit(code int) {
os.Exit(code)
}
func getMockContext() *api.Context {
c := &api.Context{}
c.RequestId = model.NewId()
c.IpAddress = "cmd_line"
c.T = utils.TfuncWithFallback(model.DEFAULT_LOCALE)
c.Locale = model.DEFAULT_LOCALE
return c
}
var usage = `Mattermost commands to help configure the system
NAME: