summaryrefslogtreecommitdiffstats
path: root/model/license.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-09-15 13:32:11 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-09-15 08:32:11 -0400
commit2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d (patch)
tree513dee966bfa8d3810ddf631df90270acd342e4f /model/license.go
parent600beb5af3e35fd82a2b06995b67629d08fe0fe3 (diff)
downloadchat-2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d.tar.gz
chat-2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d.tar.bz2
chat-2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d.zip
Model: NewLocAppError -> NewAppError (#7450)
Diffstat (limited to 'model/license.go')
-rw-r--r--model/license.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/model/license.go b/model/license.go
index d6fbcb937..5126f7c3e 100644
--- a/model/license.go
+++ b/model/license.go
@@ -6,6 +6,7 @@ package model
import (
"encoding/json"
"io"
+ "net/http"
)
const (
@@ -202,15 +203,15 @@ func LicenseFromJson(data io.Reader) *License {
func (lr *LicenseRecord) IsValid() *AppError {
if len(lr.Id) != 26 {
- return NewLocAppError("LicenseRecord.IsValid", "model.license_record.is_valid.id.app_error", nil, "")
+ return NewAppError("LicenseRecord.IsValid", "model.license_record.is_valid.id.app_error", nil, "", http.StatusBadRequest)
}
if lr.CreateAt == 0 {
- return NewLocAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "")
+ return NewAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "", http.StatusBadRequest)
}
if len(lr.Bytes) == 0 || len(lr.Bytes) > 10000 {
- return NewLocAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "")
+ return NewAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "", http.StatusBadRequest)
}
return nil