|
|
@ -178,12 +178,12 @@ func SettingsPost(ctx *context.Context) { |
|
|
|
case addrErr.IsURLError: |
|
|
|
case addrErr.IsURLError: |
|
|
|
ctx.RenderWithErr(ctx.Tr("form.url_error"), tplSettingsOptions, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("form.url_error"), tplSettingsOptions, &form) |
|
|
|
case addrErr.IsPermissionDenied: |
|
|
|
case addrErr.IsPermissionDenied: |
|
|
|
if len(addrErr.PrivateNet) == 0 { |
|
|
|
if addrErr.LocalPath { |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_private_ip"), tplSettingsOptions, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied"), tplSettingsOptions, &form) |
|
|
|
} else if !addrErr.LocalPath { |
|
|
|
} else if len(addrErr.PrivateNet) == 0 { |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_blocked"), tplSettingsOptions, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied_blocked"), tplSettingsOptions, &form) |
|
|
|
} else { |
|
|
|
} 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: |
|
|
|
case addrErr.IsInvalidPath: |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.invalid_local_path"), tplSettingsOptions, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.invalid_local_path"), tplSettingsOptions, &form) |
|
|
|