Prevent simultaneous editing of comments and issues (#31053)

fixes #22907 

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](a0828889-fb96-4bc4-8600-da92e3205812)
This commit is contained in:
metiftikci 2024-05-27 18:34:18 +03:00 committed by GitHub
parent 1ed8e6aa5f
commit aa92b13164
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 172 additions and 27 deletions

View file

@ -610,8 +610,13 @@ func EditPullRequest(ctx *context.APIContext) {
}
}
if form.Body != nil {
err = issue_service.ChangeContent(ctx, issue, ctx.Doer, *form.Body)
err = issue_service.ChangeContent(ctx, issue, ctx.Doer, *form.Body, issue.ContentVersion)
if err != nil {
if errors.Is(err, issues_model.ErrIssueAlreadyChanged) {
ctx.Error(http.StatusBadRequest, "ChangeContent", err)
return
}
ctx.Error(http.StatusInternalServerError, "ChangeContent", err)
return
}