mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-01 01:43:07 +08:00
Fix index produces problem when issues/pulls deleted (#6973)
* fix index produces problem when issues/pulls deleted * fix tests * fix tests * fix tests
This commit is contained in:
@ -251,9 +251,15 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption
|
||||
deadlineUnix = util.TimeStamp(form.Deadline.Unix())
|
||||
}
|
||||
|
||||
maxIndex, err := models.GetMaxIndexOfIssue(repo.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetPatch", err)
|
||||
return
|
||||
}
|
||||
|
||||
prIssue := &models.Issue{
|
||||
RepoID: repo.ID,
|
||||
Index: repo.NextIssueIndex(),
|
||||
Index: maxIndex + 1,
|
||||
Title: form.Title,
|
||||
PosterID: ctx.User.ID,
|
||||
Poster: ctx.User,
|
||||
|
Reference in New Issue
Block a user