mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 20:32:11 +00:00
models/issue: improve quality and performance of NewIssue function
This commit is contained in:
parent
4a46613916
commit
4042d1f0c3
13 changed files with 146 additions and 173 deletions
|
@ -149,9 +149,9 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
|
|||
}
|
||||
if ctx.Repo.IsWriter() && form.Milestone != nil &&
|
||||
issue.MilestoneID != *form.Milestone {
|
||||
oldMid := issue.MilestoneID
|
||||
oldMilestoneID := issue.MilestoneID
|
||||
issue.MilestoneID = *form.Milestone
|
||||
if err = models.ChangeMilestoneAssign(oldMid, issue); err != nil {
|
||||
if err = models.ChangeMilestoneAssign(issue, oldMilestoneID); err != nil {
|
||||
ctx.Error(500, "ChangeMilestoneAssign", err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue