summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorKN4CK3R <KN4CK3R@users.noreply.github.com>2021-03-17 03:34:09 +0100
committerGitHub <noreply@github.com>2021-03-17 03:34:09 +0100
commit7019076f7f2e144c95f30469aea9d7c9cb52d9fb (patch)
tree04acb03ee071b355719729e92ee067bfce2e5250 /routers/repo
parent5bb544e3ae0248f8f6ce842a3e0ca7dbb16c2f66 (diff)
downloadgitea-7019076f7f2e144c95f30469aea9d7c9cb52d9fb.tar.gz
gitea-7019076f7f2e144c95f30469aea9d7c9cb52d9fb.zip
Fixed wrong migrate url error description. (#15010)
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/migrate.go8
-rw-r--r--routers/repo/setting.go8
2 files changed, 8 insertions, 8 deletions
diff --git a/routers/repo/migrate.go b/routers/repo/migrate.go
index fbc4288c1e..6b4e7852ae 100644
--- a/routers/repo/migrate.go
+++ b/routers/repo/migrate.go
@@ -153,12 +153,12 @@ func MigratePost(ctx *context.Context) {
case addrErr.IsURLError:
ctx.RenderWithErr(ctx.Tr("form.url_error"), tpl, &form)
case addrErr.IsPermissionDenied:
- if len(addrErr.PrivateNet) == 0 {
- ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_private_ip"), tpl, &form)
- } else if !addrErr.LocalPath {
+ if addrErr.LocalPath {
+ ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied"), tpl, &form)
+ } else if len(addrErr.PrivateNet) == 0 {
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_blocked"), tpl, &form)
} else {
- ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied"), tpl, &form)
+ ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_private_ip"), tpl, &form)
}
case addrErr.IsInvalidPath:
ctx.RenderWithErr(ctx.Tr("repo.migrate.invalid_local_path"), tpl, &form)
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 3c7524e4e6..dc14b69b3b 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -178,12 +178,12 @@ func SettingsPost(ctx *context.Context) {
case addrErr.IsURLError:
ctx.RenderWithErr(ctx.Tr("form.url_error"), tplSettingsOptions, &form)
case addrErr.IsPermissionDenied:
- if len(addrErr.PrivateNet) == 0 {
- ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_private_ip"), tplSettingsOptions, &form)
- } else if !addrErr.LocalPath {
+ if addrErr.LocalPath {
+ ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied"), tplSettingsOptions, &form)
+ } else if len(addrErr.PrivateNet) == 0 {
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_blocked"), tplSettingsOptions, &form)
} else {
- ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied"), tplSettingsOptions, &form)
+ ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_private_ip"), tplSettingsOptions, &form)
}
case addrErr.IsInvalidPath:
ctx.RenderWithErr(ctx.Tr("repo.migrate.invalid_local_path"), tplSettingsOptions, &form)