From 5e5139faed1bb95161a9cae12672f4c27b1fa925 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 27 Feb 2018 20:03:10 +0100 Subject: [PATCH] Simplify error --- routers/repo/issue_dependency.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routers/repo/issue_dependency.go b/routers/repo/issue_dependency.go index 76034b147..23c914c7b 100644 --- a/routers/repo/issue_dependency.go +++ b/routers/repo/issue_dependency.go @@ -28,7 +28,7 @@ func AddDependency(ctx *context.Context) { // Check if the Repo is allowed to have dependencies if !ctx.Repo.CanCreateIssueDependencies(ctx.User) { - ctx.NotFound("NotAllowedToCreateIssueDependencies", nil) + ctx.NotFound("CanCreateIssueDependencies", nil) return } @@ -48,6 +48,7 @@ func AddDependency(ctx *context.Context) { // Check if issue and dependency is the same if dep.Index == issueIndex { ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_same_issue")) + return } else { err := models.CreateIssueDependency(ctx.User, issue, dep) if err != nil { @@ -76,7 +77,7 @@ func RemoveDependency(ctx *context.Context) { // Check if the Repo is allowed to have dependencies if !ctx.Repo.CanCreateIssueDependencies(ctx.User) { - ctx.NotFound("NotAllowedToCreateIssueDependencies", nil) + ctx.NotFound("CanCreateIssueDependencies", nil) return }