summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-02-26 22:28:56 +0800
committertechknowlogick <matti@mdranta.net>2019-02-26 09:28:56 -0500
commit7afe81f28e530c1c5aed1583654b3d772c368fa5 (patch)
tree5ba60966477f6059aa94f6625292b75ba964e3b8 /routers/repo/repo.go
parent594f59169129889387d792f6aa571150d4118dc6 (diff)
downloadgitea-7afe81f28e530c1c5aed1583654b3d772c368fa5.tar.gz
gitea-7afe81f28e530c1c5aed1583654b3d772c368fa5.zip
fix bug when migrate repository 500 when repo is existed (#6188)
* fix bug when migrate repository 500 when repo is existed * use 409 but not 422 for error status code when not exist * translation fix
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 960961a5e5..42dfd56268 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -256,6 +256,11 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
return
}
+ if models.IsErrRepoAlreadyExist(err) {
+ ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), tplMigrate, &form)
+ return
+ }
+
// remoteAddr may contain credentials, so we sanitize it
err = util.URLSanitizedError(err, remoteAddr)