Simplify error
This commit is contained in:
parent
91e0b53d26
commit
5e5139faed
|
|
@ -28,7 +28,7 @@ func AddDependency(ctx *context.Context) {
|
||||||
|
|
||||||
// Check if the Repo is allowed to have dependencies
|
// Check if the Repo is allowed to have dependencies
|
||||||
if !ctx.Repo.CanCreateIssueDependencies(ctx.User) {
|
if !ctx.Repo.CanCreateIssueDependencies(ctx.User) {
|
||||||
ctx.NotFound("NotAllowedToCreateIssueDependencies", nil)
|
ctx.NotFound("CanCreateIssueDependencies", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,6 +48,7 @@ func AddDependency(ctx *context.Context) {
|
||||||
// Check if issue and dependency is the same
|
// Check if issue and dependency is the same
|
||||||
if dep.Index == issueIndex {
|
if dep.Index == issueIndex {
|
||||||
ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_same_issue"))
|
ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_same_issue"))
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
err := models.CreateIssueDependency(ctx.User, issue, dep)
|
err := models.CreateIssueDependency(ctx.User, issue, dep)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -76,7 +77,7 @@ func RemoveDependency(ctx *context.Context) {
|
||||||
|
|
||||||
// Check if the Repo is allowed to have dependencies
|
// Check if the Repo is allowed to have dependencies
|
||||||
if !ctx.Repo.CanCreateIssueDependencies(ctx.User) {
|
if !ctx.Repo.CanCreateIssueDependencies(ctx.User) {
|
||||||
ctx.NotFound("NotAllowedToCreateIssueDependencies", nil)
|
ctx.NotFound("CanCreateIssueDependencies", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user