diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/file.go | 3 | ||||
-rw-r--r-- | app/post.go | 2 | ||||
-rw-r--r-- | app/webhook.go | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/app/file.go b/app/file.go index 832ff77d4..36a23e3d8 100644 --- a/app/file.go +++ b/app/file.go @@ -309,8 +309,7 @@ func (a *App) DoUploadFile(now time.Time, teamId string, channelId string, userI if info.IsImage() { // Check dimensions before loading the whole thing into memory later on if info.Width*info.Height > MaxImageSize { - err := model.NewLocAppError("uploadFile", "api.file.upload_file.large_image.app_error", map[string]interface{}{"Filename": filename}, "") - err.StatusCode = http.StatusBadRequest + err := model.NewAppError("uploadFile", "api.file.upload_file.large_image.app_error", map[string]interface{}{"Filename": filename}, "", http.StatusBadRequest) return nil, err } diff --git a/app/post.go b/app/post.go index feb024fb1..e81af4673 100644 --- a/app/post.go +++ b/app/post.go @@ -114,7 +114,7 @@ func (a *App) CreatePost(post *model.Post, channel *model.Channel, triggerWebhoo !post.IsSystemMessage() && channel.Name == model.DEFAULT_CHANNEL && !CheckIfRolesGrantPermission(user.GetRoles(), model.PERMISSION_MANAGE_SYSTEM.Id) { - return nil, model.NewLocAppError("createPost", "api.post.create_post.town_square_read_only", nil, "") + return nil, model.NewAppError("createPost", "api.post.create_post.town_square_read_only", nil, "", http.StatusForbidden) } // Verify the parent/child relationships are correct diff --git a/app/webhook.go b/app/webhook.go index 04887f203..380839cdc 100644 --- a/app/webhook.go +++ b/app/webhook.go @@ -522,7 +522,7 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq if utils.IsLicensed() && *utils.Cfg.TeamSettings.ExperimentalTownSquareIsReadOnly && channel.Name == model.DEFAULT_CHANNEL { - return model.NewLocAppError("HandleIncomingWebhook", "api.post.create_post.town_square_read_only", nil, "") + return model.NewAppError("HandleIncomingWebhook", "api.post.create_post.town_square_read_only", nil, "", http.StatusForbidden) } if channel.Type != model.CHANNEL_OPEN && !a.HasPermissionToChannel(hook.UserId, channel.Id, model.PERMISSION_READ_CHANNEL) { |