diff options
author | 6543 <6543@obermui.de> | 2020-01-01 23:51:10 +0100 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2020-01-01 17:51:10 -0500 |
commit | c620eb5b2d0d874da68ebd734d3864c5224f71f7 (patch) | |
tree | 340d2846fba024170ce31003af666814bb31bc33 /routers/api/v1/repo/pull.go | |
parent | d1798f77f62988828c004fcf8d234bff6340deb7 (diff) | |
download | gitea-c620eb5b2d0d874da68ebd734d3864c5224f71f7.tar.gz gitea-c620eb5b2d0d874da68ebd734d3864c5224f71f7.zip |
Fix #9189 - API Allow only specific Colums to be updated on Issue (#9539)
* dont insert "-1" in any case to issue.poster_id
* Make sure API cant override importand fields
* code format
* fix lint
* WIP test
* add missing poster_id
* fix test
* user.IsGhost handle nil
* CI.restart()
* make sure no -1 is realy added
* CI.restart()
* @lunny suggestion remove some not allowed fields
* seperate issue.LoadMilestone
* load milestone and return it on IssueEdit via API
* extend Test for TestAPIEditIssue
* fix fixtures
* declare allowedColumnsUpdateIssueByAPI only once
* Update Year
* no var just write id drecty into func cal
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers/api/v1/repo/pull.go')
-rw-r--r-- | routers/api/v1/repo/pull.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 0392eb8e8c..d0551320fd 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -450,8 +450,8 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) { } } - if err = models.UpdateIssue(issue); err != nil { - ctx.Error(http.StatusInternalServerError, "UpdateIssue", err) + if err = models.UpdateIssueByAPI(issue); err != nil { + ctx.Error(http.StatusInternalServerError, "UpdateIssueByAPI", err) return } if form.State != nil { |