summaryrefslogtreecommitdiffstats
path: root/routers/repo/wiki.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/wiki.go')
-rw-r--r--routers/repo/wiki.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/repo/wiki.go b/routers/repo/wiki.go
index 5da01f21ac..cc60b4388d 100644
--- a/routers/repo/wiki.go
+++ b/routers/repo/wiki.go
@@ -572,6 +572,11 @@ func NewWikiPost(ctx *context.Context, form auth.NewWikiForm) {
}
wikiName := wiki_service.NormalizeWikiName(form.Title)
+
+ if len(form.Message) == 0 {
+ form.Message = ctx.Tr("repo.editor.add", form.Title)
+ }
+
if err := wiki_service.AddWikiPage(ctx.User, ctx.Repo.Repository, wikiName, form.Content, form.Message); err != nil {
if models.IsErrWikiReservedName(err) {
ctx.Data["Err_Title"] = true
@@ -621,6 +626,10 @@ func EditWikiPost(ctx *context.Context, form auth.NewWikiForm) {
oldWikiName := wiki_service.NormalizeWikiName(ctx.Params(":page"))
newWikiName := wiki_service.NormalizeWikiName(form.Title)
+ if len(form.Message) == 0 {
+ form.Message = ctx.Tr("repo.editor.update", form.Title)
+ }
+
if err := wiki_service.EditWikiPage(ctx.User, ctx.Repo.Repository, oldWikiName, newWikiName, form.Content, form.Message); err != nil {
ctx.ServerError("EditWikiPage", err)
return