]> source.dussan.org Git - gitea.git/commitdiff
Fixed wrong migrate url error description. (#15010)
authorKN4CK3R <KN4CK3R@users.noreply.github.com>
Wed, 17 Mar 2021 02:34:09 +0000 (03:34 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Mar 2021 02:34:09 +0000 (03:34 +0100)
routers/repo/migrate.go
routers/repo/setting.go

index fbc4288c1ed5447e1f57feb62df1bf6e47bdc07a..6b4e7852ae2886c7bb350526cd6518cf40f2833a 100644 (file)
@@ -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)
index 3c7524e4e6938319bd5c238258cc7c65a520977b..dc14b69b3b0b090c913620f7baba2d5bf7cd64fd 100644 (file)
@@ -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)