summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/compliance.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/compliance.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/compliance.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/mattermost/platform/model/compliance.go b/vendor/github.com/mattermost/platform/model/compliance.go
index 14f8f4a5..3134ddba 100644
--- a/vendor/github.com/mattermost/platform/model/compliance.go
+++ b/vendor/github.com/mattermost/platform/model/compliance.go
@@ -6,6 +6,7 @@ package model
import (
"encoding/json"
"io"
+ "net/http"
"strings"
)
@@ -75,27 +76,27 @@ func (me *Compliance) JobName() string {
func (me *Compliance) IsValid() *AppError {
if len(me.Id) != 26 {
- return NewLocAppError("Compliance.IsValid", "model.compliance.is_valid.id.app_error", nil, "")
+ return NewAppError("Compliance.IsValid", "model.compliance.is_valid.id.app_error", nil, "", http.StatusBadRequest)
}
if me.CreateAt == 0 {
- return NewLocAppError("Compliance.IsValid", "model.compliance.is_valid.create_at.app_error", nil, "")
+ return NewAppError("Compliance.IsValid", "model.compliance.is_valid.create_at.app_error", nil, "", http.StatusBadRequest)
}
if len(me.Desc) > 512 || len(me.Desc) == 0 {
- return NewLocAppError("Compliance.IsValid", "model.compliance.is_valid.desc.app_error", nil, "")
+ return NewAppError("Compliance.IsValid", "model.compliance.is_valid.desc.app_error", nil, "", http.StatusBadRequest)
}
if me.StartAt == 0 {
- return NewLocAppError("Compliance.IsValid", "model.compliance.is_valid.start_at.app_error", nil, "")
+ return NewAppError("Compliance.IsValid", "model.compliance.is_valid.start_at.app_error", nil, "", http.StatusBadRequest)
}
if me.EndAt == 0 {
- return NewLocAppError("Compliance.IsValid", "model.compliance.is_valid.end_at.app_error", nil, "")
+ return NewAppError("Compliance.IsValid", "model.compliance.is_valid.end_at.app_error", nil, "", http.StatusBadRequest)
}
if me.EndAt <= me.StartAt {
- return NewLocAppError("Compliance.IsValid", "model.compliance.is_valid.start_end_at.app_error", nil, "")
+ return NewAppError("Compliance.IsValid", "model.compliance.is_valid.start_end_at.app_error", nil, "", http.StatusBadRequest)
}
return nil