if milestone id is zero don't get it from database (#7174)
This commit is contained in:
parent
5e97b2d00e
commit
10effb396a
|
@ -406,12 +406,14 @@ func NewIssue(ctx *context.Context) {
|
|||
ctx.Data["BodyQuery"] = body
|
||||
|
||||
milestoneID := ctx.QueryInt64("milestone")
|
||||
milestone, err := models.GetMilestoneByID(milestoneID)
|
||||
if err != nil {
|
||||
log.Error(4, "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(4, "GetMilestoneByID: %d: %v", milestoneID, err)
|
||||
} else {
|
||||
ctx.Data["milestone_id"] = milestoneID
|
||||
ctx.Data["Milestone"] = milestone
|
||||
}
|
||||
}
|
||||
|
||||
setTemplateIfExists(ctx, issueTemplateKey, IssueTemplateCandidates)
|
||||
|
|
Loading…
Reference in New Issue