@@ -51,17 +51,15 @@ const (
51
51
issueTemplateTitleKey = "IssueTemplateTitle"
52
52
)
53
53
54
- var (
55
- // IssueTemplateCandidates issue templates
56
- IssueTemplateCandidates = []string {
57
- "ISSUE_TEMPLATE.md" ,
58
- "issue_template.md" ,
59
- ".gitea/ISSUE_TEMPLATE.md" ,
60
- ".gitea/issue_template.md" ,
61
- ".github/ISSUE_TEMPLATE.md" ,
62
- ".github/issue_template.md" ,
63
- }
64
- )
54
+ // IssueTemplateCandidates issue templates
55
+ var IssueTemplateCandidates = []string {
56
+ "ISSUE_TEMPLATE.md" ,
57
+ "issue_template.md" ,
58
+ ".gitea/ISSUE_TEMPLATE.md" ,
59
+ ".gitea/issue_template.md" ,
60
+ ".github/ISSUE_TEMPLATE.md" ,
61
+ ".github/issue_template.md" ,
62
+ }
65
63
66
64
// MustAllowUserComment checks to make sure if an issue is locked.
67
65
// If locked and user has permissions to write to the repository,
@@ -239,7 +237,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
239
237
}
240
238
}
241
239
242
- var issueList = models .IssueList (issues )
240
+ issueList : = models .IssueList (issues )
243
241
approvalCounts , err := issueList .GetApprovalCounts ()
244
242
if err != nil {
245
243
ctx .ServerError ("ApprovalCounts" , err )
@@ -422,7 +420,6 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repos
422
420
}
423
421
424
422
func retrieveProjects (ctx * context.Context , repo * models.Repository ) {
425
-
426
423
var err error
427
424
428
425
ctx .Data ["OpenProjects" ], _ , err = models .GetProjects (models.ProjectSearchOptions {
@@ -781,7 +778,7 @@ func NewIssue(ctx *context.Context) {
781
778
782
779
milestoneID := ctx .QueryInt64 ("milestone" )
783
780
if milestoneID > 0 {
784
- milestone , err := models .GetMilestoneByID ( milestoneID )
781
+ milestone , err := models .GetMilestoneByRepoID ( ctx . Repo . Repository . ID , milestoneID )
785
782
if err != nil {
786
783
log .Error ("GetMilestoneByID: %d: %v" , milestoneID , err )
787
784
} else {
@@ -865,7 +862,7 @@ func ValidateRepoMetas(ctx *context.Context, form forms.CreateIssueForm, isPull
865
862
// Check milestone.
866
863
milestoneID := form .MilestoneID
867
864
if milestoneID > 0 {
868
- ctx .Data ["Milestone" ], err = repo . GetMilestoneByID ( milestoneID )
865
+ ctx .Data ["Milestone" ], err = models . GetMilestoneByRepoID ( ctx . Repo . Repository . ID , milestoneID )
869
866
if err != nil {
870
867
ctx .ServerError ("GetMilestoneByID" , err )
871
868
return nil , nil , 0 , 0
@@ -2446,7 +2443,7 @@ func filterXRefComments(ctx *context.Context, issue *models.Issue) error {
2446
2443
// GetIssueAttachments returns attachments for the issue
2447
2444
func GetIssueAttachments (ctx * context.Context ) {
2448
2445
issue := GetActionIssue (ctx )
2449
- var attachments = make ([]* api.Attachment , len (issue .Attachments ))
2446
+ attachments : = make ([]* api.Attachment , len (issue .Attachments ))
2450
2447
for i := 0 ; i < len (issue .Attachments ); i ++ {
2451
2448
attachments [i ] = convert .ToReleaseAttachment (issue .Attachments [i ])
2452
2449
}
@@ -2460,7 +2457,7 @@ func GetCommentAttachments(ctx *context.Context) {
2460
2457
ctx .NotFoundOrServerError ("GetCommentByID" , models .IsErrCommentNotExist , err )
2461
2458
return
2462
2459
}
2463
- var attachments = make ([]* api.Attachment , 0 )
2460
+ attachments : = make ([]* api.Attachment , 0 )
2464
2461
if comment .Type == models .CommentTypeComment {
2465
2462
if err := comment .LoadAttachments (); err != nil {
2466
2463
ctx .ServerError ("LoadAttachments" , err )
0 commit comments