#809 fix wrong closed issue count when create closed issue via API
Add start count corrector for Repository.NumClosedIssues
This commit is contained in:
parent
28c03f1147
commit
e9ae926e04
5 changed files with 29 additions and 6 deletions
|
@ -57,7 +57,6 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) {
|
|||
PosterID: ctx.User.Id,
|
||||
Poster: ctx.User,
|
||||
Content: form.Body,
|
||||
IsClosed: form.Closed,
|
||||
}
|
||||
|
||||
if ctx.Repo.IsWriter() {
|
||||
|
@ -86,6 +85,13 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) {
|
|||
return
|
||||
}
|
||||
|
||||
if form.Closed {
|
||||
if err := issue.ChangeStatus(ctx.User, ctx.Repo.Repository, true); err != nil {
|
||||
ctx.Error(500, "issue.ChangeStatus", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Refetch from database to assign some automatic values
|
||||
var err error
|
||||
issue, err = models.GetIssueByID(issue.ID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue