summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-07-12 16:55:46 +0800
committerGitHub <noreply@github.com>2019-07-12 16:55:46 +0800
commitd95237b56199934418816aaef4881ca538637c05 (patch)
tree2057576ee03db497529f301aed01b53ecc8726f8 /routers/repo/repo.go
parentefaee46b4df538e23367a7f4e2205f446b6c709b (diff)
downloadgitea-d95237b56199934418816aaef4881ca538637c05.tar.gz
gitea-d95237b56199934418816aaef4881ca538637c05.zip
add notification placeholder (#7409)
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 49483a64e4..8c63d73b38 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -17,6 +17,7 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/migrations"
+ "code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
@@ -178,6 +179,8 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
AutoInit: form.AutoInit,
})
if err == nil {
+ notification.NotifyCreateRepository(ctx.User, ctxUser, repo)
+
log.Trace("Repository created [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name)
return
@@ -278,6 +281,8 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
repo, err := migrations.MigrateRepository(ctx.User, ctxUser.Name, opts)
if err == nil {
+ notification.NotifyCreateRepository(ctx.User, ctxUser, repo)
+
log.Trace("Repository migrated [%d]: %s/%s successfully", repo.ID, ctxUser.Name, form.RepoName)
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + form.RepoName)
return