summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue_dependency.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/issue_dependency.go')
-rw-r--r--routers/repo/issue_dependency.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/repo/issue_dependency.go b/routers/repo/issue_dependency.go
index 730271126d..6b11f0cdf1 100644
--- a/routers/repo/issue_dependency.go
+++ b/routers/repo/issue_dependency.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
+ "code.gitea.io/gitea/modules/setting"
)
// AddDependency adds new dependencies
@@ -39,14 +40,14 @@ func AddDependency(ctx *context.Context) {
return
}
- // Check if both issues are in the same repo
- if issue.RepoID != dep.RepoID {
+ // Check if both issues are in the same repo if cross repository dependencies is not enabled
+ if issue.RepoID != dep.RepoID && !setting.Service.AllowCrossRepositoryDependencies {
ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_dep_not_same_repo"))
return
}
// Check if issue and dependency is the same
- if dep.Index == issueIndex {
+ if dep.ID == issue.ID {
ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_same_issue"))
return
}