1
1
mirror of https://github.com/go-gitea/gitea synced 2025-12-07 13:28:25 +00:00

Add transaction for ReopenIssue

This commit is contained in:
Lunny Xiao
2024-11-10 13:42:16 -08:00
parent ed261f1403
commit fdff19948a
2 changed files with 29 additions and 4 deletions

View File

@@ -139,7 +139,20 @@ func ReopenIssue(ctx context.Context, issue *Issue, doer *user_model.User) (*Com
return nil, err
}
return changeIssueStatus(ctx, issue, doer, false, false)
ctx, committer, err := db.TxContext(ctx)
if err != nil {
return nil, err
}
defer committer.Close()
comment, err := changeIssueStatus(ctx, issue, doer, false, false)
if err != nil {
return nil, err
}
if err := committer.Commit(); err != nil {
return nil, err
}
return comment, nil
}
// ChangeIssueTitle changes the title of this issue, as the given user.