add notification placeholder (#7409)
This commit is contained in:
parent
efaee46b4d
commit
d95237b561
2 changed files with 10 additions and 0 deletions
|
@ -15,6 +15,7 @@ import (
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/migrations"
|
"code.gitea.io/gitea/modules/migrations"
|
||||||
|
"code.gitea.io/gitea/modules/notification"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
"code.gitea.io/gitea/routers/api/v1/convert"
|
"code.gitea.io/gitea/routers/api/v1/convert"
|
||||||
|
@ -220,6 +221,8 @@ func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateR
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notification.NotifyCreateRepository(ctx.User, owner, repo)
|
||||||
|
|
||||||
ctx.JSON(201, repo.APIFormat(models.AccessModeOwner))
|
ctx.JSON(201, repo.APIFormat(models.AccessModeOwner))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,6 +413,8 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
|
||||||
|
|
||||||
repo, err := migrations.MigrateRepository(ctx.User, ctxUser.Name, opts)
|
repo, err := migrations.MigrateRepository(ctx.User, ctxUser.Name, opts)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
notification.NotifyCreateRepository(ctx.User, ctxUser, repo)
|
||||||
|
|
||||||
log.Trace("Repository migrated: %s/%s", ctxUser.Name, form.RepoName)
|
log.Trace("Repository migrated: %s/%s", ctxUser.Name, form.RepoName)
|
||||||
ctx.JSON(201, repo.APIFormat(models.AccessModeAdmin))
|
ctx.JSON(201, repo.APIFormat(models.AccessModeAdmin))
|
||||||
return
|
return
|
||||||
|
|
|
@ -17,6 +17,7 @@ import (
|
||||||
"code.gitea.io/gitea/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/migrations"
|
"code.gitea.io/gitea/modules/migrations"
|
||||||
|
"code.gitea.io/gitea/modules/notification"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
|
@ -178,6 +179,8 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
|
||||||
AutoInit: form.AutoInit,
|
AutoInit: form.AutoInit,
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
notification.NotifyCreateRepository(ctx.User, ctxUser, repo)
|
||||||
|
|
||||||
log.Trace("Repository created [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
|
log.Trace("Repository created [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
|
||||||
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name)
|
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name)
|
||||||
return
|
return
|
||||||
|
@ -278,6 +281,8 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
|
||||||
|
|
||||||
repo, err := migrations.MigrateRepository(ctx.User, ctxUser.Name, opts)
|
repo, err := migrations.MigrateRepository(ctx.User, ctxUser.Name, opts)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
notification.NotifyCreateRepository(ctx.User, ctxUser, repo)
|
||||||
|
|
||||||
log.Trace("Repository migrated [%d]: %s/%s successfully", repo.ID, ctxUser.Name, form.RepoName)
|
log.Trace("Repository migrated [%d]: %s/%s successfully", repo.ID, ctxUser.Name, form.RepoName)
|
||||||
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + form.RepoName)
|
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + form.RepoName)
|
||||||
return
|
return
|
||||||
|
|
Reference in a new issue