Browse Source

if milestone id is zero don't get it from database (#7169)

for-closed-social
Lunny Xiao 5 years ago
committed by GitHub
parent
commit
7162fbf3d6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      routers/repo/issue.go

+ 8
- 6
routers/repo/issue.go View File

@ -426,12 +426,14 @@ func NewIssue(ctx *context.Context) {
ctx.Data["BodyQuery"] = body
milestoneID := ctx.QueryInt64("milestone")
milestone, err := models.GetMilestoneByID(milestoneID)
if err != nil {
log.Error("GetMilestoneByID: %d: %v", milestoneID, err)
} else {
ctx.Data["milestone_id"] = milestoneID
ctx.Data["Milestone"] = milestone
if milestoneID > 0 {
milestone, err := models.GetMilestoneByID(milestoneID)
if err != nil {
log.Error("GetMilestoneByID: %d: %v", milestoneID, err)
} else {
ctx.Data["milestone_id"] = milestoneID
ctx.Data["Milestone"] = milestone
}
}
setTemplateIfExists(ctx, issueTemplateKey, IssueTemplateCandidates)

Loading…
Cancel
Save