Fixing build
Этот коммит содержится в:
@@ -5,7 +5,6 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
|
||||||
l4g "github.com/alecthomas/log4go"
|
l4g "github.com/alecthomas/log4go"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/mattermost/platform/model"
|
"github.com/mattermost/platform/model"
|
||||||
@@ -65,13 +64,13 @@ func addLicense(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
license = model.LicenseFromJson(strings.NewReader(licenseStr))
|
license = model.LicenseFromJson(strings.NewReader(licenseStr))
|
||||||
|
|
||||||
if result := <-Srv.Store.User().AnalyticsUniqueUserCount(""); result.Err != nil {
|
if result := <-Srv.Store.User().AnalyticsUniqueUserCount(""); result.Err != nil {
|
||||||
c.Err = model.NewLocAppError("addLicense", api.license.add_license.invalid_count.app_error, nil, result.Err.Error())
|
c.Err = model.NewLocAppError("addLicense", "api.license.add_license.invalid_count.app_error", nil, result.Err.Error())
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
uniqueUserCount := result.Data.(int64)
|
uniqueUserCount := result.Data.(int64)
|
||||||
|
|
||||||
if uniqueUserCount > int64(*license.Features.Users) {
|
if uniqueUserCount > int64(*license.Features.Users) {
|
||||||
c.Err = model.NewAppError("addLicense", api.license.add_license.unique_users.app_error, map[string]interface{}{"Users": *license.Features.Users, "Count": uniqueUserCount})
|
c.Err = model.NewLocAppError("addLicense", "api.license.add_license.unique_users.app_error", map[string]interface{}{"Users": *license.Features.Users, "Count": uniqueUserCount}, "")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ func TestRandomString(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAppError(t *testing.T) {
|
func TestAppError(t *testing.T) {
|
||||||
err := NewAppError("TestAppError", "message", "")
|
err := NewLocAppError("TestAppError", "message", nil, "")
|
||||||
json := err.ToJson()
|
json := err.ToJson()
|
||||||
rerr := AppErrorFromJson(strings.NewReader(json))
|
rerr := AppErrorFromJson(strings.NewReader(json))
|
||||||
if err.Message != rerr.Message {
|
if err.Message != rerr.Message {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user