diff options
author | Martin Hartkorn <github@hartkorn.net> | 2016-02-14 21:22:36 +0100 |
---|---|---|
committer | Martin Hartkorn <github@hartkorn.net> | 2016-02-14 21:22:36 +0100 |
commit | 15394f613f7c03d23903d75f12ba018b3b76dffa (patch) | |
tree | 9ddd772d69e4439625fbcba22330e37e9baad3e2 /routers/repo/setting.go | |
parent | 3650bd8528a8c0f43eb3d9083939735bf740fa3b (diff) | |
download | gitea-15394f613f7c03d23903d75f12ba018b3b76dffa.tar.gz gitea-15394f613f7c03d23903d75f12ba018b3b76dffa.zip |
Add missing safety check
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r-- | routers/repo/setting.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 9d7e4074c3..690e7a4652 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -154,6 +154,11 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { } } + if !repo.IsMirror { + ctx.Error(404) + return + } + repo.IsMirror = false if _, err := models.FinishMigrateRepository(repo, models.RepoPath(ctx.Repo.Owner.Name, repo.Name)); err != nil { |