diff options
author | Unknwon <u@gogs.io> | 2015-12-04 21:30:33 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-04 21:30:33 -0500 |
commit | e538ff27704cddb1a99efc1a6be19e134f97355f (patch) | |
tree | 88f93b17d47aeb3ac4dd0692f5c5b613ee38b28b /routers/repo/setting.go | |
parent | 76d4b9288b60ed6c037257415a570225764ff0a0 (diff) | |
download | gitea-e538ff27704cddb1a99efc1a6be19e134f97355f.tar.gz gitea-e538ff27704cddb1a99efc1a6be19e134f97355f.zip |
fix #1829 and fix #890
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r-- | routers/repo/setting.go | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 24ab91eec0..0a219c73bf 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -104,7 +104,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { ctx.Handle(500, "UpdateRepository", err) return } - log.Trace("Repository updated: %s/%s", ctx.Repo.Owner.Name, repo.Name) + log.Trace("Repository basic settings updated: %s/%s", ctx.Repo.Owner.Name, repo.Name) if isNameChanged { if err := models.RenameRepoAction(ctx.User, oldRepoName, repo); err != nil { @@ -123,7 +123,24 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { } ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success")) - ctx.Redirect(fmt.Sprintf("%s/%s/%s/settings", setting.AppSubUrl, ctx.Repo.Owner.Name, repo.Name)) + ctx.Redirect(ctx.Repo.RepoLink + "/settings") + + case "advanced": + repo.EnableWiki = form.EnableWiki + repo.EnableIssues = form.EnableIssues + repo.EnableExternalTracker = form.EnableExternalTracker + repo.ExternalTrackerFormat = form.TrackerURLFormat + repo.EnablePulls = form.EnablePulls + + if err := models.UpdateRepository(repo, false); err != nil { + ctx.Handle(500, "UpdateRepository", err) + return + } + log.Trace("Repository advanced settings updated: %s/%s", ctx.Repo.Owner.Name, repo.Name) + + ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success")) + ctx.Redirect(ctx.Repo.RepoLink + "/settings") + case "transfer": if repo.Name != form.RepoName { ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil) |