Fix bug with globally disabling mirror (#11760)

Ensure we return after `ctx.Error(...)`
This commit is contained in:
6543 2020-06-04 20:06:24 +02:00 committed by GitHub
parent 0cb22121f4
commit 2c5b3c72e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -115,6 +115,7 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
if form.Mirror && setting.Repository.DisableMirrors {
ctx.Error(http.StatusForbidden, "MirrorsGlobalDisabled", fmt.Errorf("the site administrator has disabled mirrors"))
return
}
var opts = migrations.MigrateOptions{