aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-24 16:05:56 -0700
committerUnknwon <u@gogs.io>2016-08-24 16:05:56 -0700
commit0b273ac4d566837b668d9e521476cd94ac28b6d4 (patch)
tree034db5238583a8f73bc5c83c2e4f1ae724eea092 /routers/repo/issue.go
parent84b56c3c53fb931f569f9d0b5e2bf3832aba6abe (diff)
downloadgitea-0b273ac4d566837b668d9e521476cd94ac28b6d4.tar.gz
gitea-0b273ac4d566837b668d9e521476cd94ac28b6d4.zip
#3383 code cleanup
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 37731e5ee6..2c23a7bea3 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -210,7 +210,7 @@ func Issues(ctx *context.Context) {
ctx.Data["Issues"] = issues
// Get milestones.
- ctx.Data["Milestones"], err = models.GetAllRepoMilestones(repo.ID)
+ ctx.Data["Milestones"], err = models.GetMilestonesByRepoID(repo.ID)
if err != nil {
ctx.Handle(500, "GetAllRepoMilestones", err)
return
@@ -1099,12 +1099,12 @@ func EditMilestone(ctx *context.Context) {
ctx.Data["RequireDatetimepicker"] = true
ctx.Data["DateLang"] = setting.DateLang(ctx.Locale.Language())
- m, err := models.GetMilestoneByID(ctx.ParamsInt64(":id"))
+ m, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
if err != nil {
if models.IsErrMilestoneNotExist(err) {
- ctx.Handle(404, "GetMilestoneByID", nil)
+ ctx.Handle(404, "", nil)
} else {
- ctx.Handle(500, "GetMilestoneByID", err)
+ ctx.Handle(500, "GetMilestoneByRepoID", err)
}
return
}
@@ -1138,12 +1138,12 @@ func EditMilestonePost(ctx *context.Context, form auth.CreateMilestoneForm) {
return
}
- m, err := models.GetMilestoneByID(ctx.ParamsInt64(":id"))
+ m, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
if err != nil {
if models.IsErrMilestoneNotExist(err) {
- ctx.Handle(404, "GetMilestoneByID", nil)
+ ctx.Handle(404, "", nil)
} else {
- ctx.Handle(500, "GetMilestoneByID", err)
+ ctx.Handle(500, "GetMilestoneByRepoID", err)
}
return
}
@@ -1160,12 +1160,12 @@ func EditMilestonePost(ctx *context.Context, form auth.CreateMilestoneForm) {
}
func ChangeMilestonStatus(ctx *context.Context) {
- m, err := models.GetMilestoneByID(ctx.ParamsInt64(":id"))
+ m, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
if err != nil {
if models.IsErrMilestoneNotExist(err) {
- ctx.Handle(404, "GetMilestoneByID", err)
+ ctx.Handle(404, "", err)
} else {
- ctx.Handle(500, "GetMilestoneByID", err)
+ ctx.Handle(500, "GetMilestoneByRepoID", err)
}
return
}
@@ -1194,8 +1194,8 @@ func ChangeMilestonStatus(ctx *context.Context) {
}
func DeleteMilestone(ctx *context.Context) {
- if err := models.DeleteMilestoneByID(ctx.QueryInt64("id")); err != nil {
- ctx.Flash.Error("DeleteMilestoneByID: " + err.Error())
+ if err := models.DeleteMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.QueryInt64("id")); err != nil {
+ ctx.Flash.Error("DeleteMilestoneByRepoID: " + err.Error())
} else {
ctx.Flash.Success(ctx.Tr("repo.milestones.deletion_success"))
}