diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-07-15 16:52:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-15 11:52:03 +0300 |
commit | 9672085d940830f2e2e6d6f71e0e9900db5284a4 (patch) | |
tree | cd6a6df1dabe542cf832d3ce0921fb268fe4305a /routers | |
parent | faf28b28233b18289e0a398ea22265bb87b1e1b5 (diff) | |
download | gitea-9672085d940830f2e2e6d6f71e0e9900db5284a4.tar.gz gitea-9672085d940830f2e2e6d6f71e0e9900db5284a4.zip |
Fix "Flash" message usage (#25895)
Resolve https://github.com/go-gitea/gitea/pull/25820/files#r1264309059
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/pull.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index 505e1424cd..c5f260adfa 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -175,10 +175,8 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository { } else if len(orgs) > 0 { ctx.Data["ContextUser"] = orgs[0] } else { - msg := ctx.Tr("repo.fork_no_valid_owners") - ctx.Data["Flash"] = ctx.Flash - ctx.Flash.Error(msg) ctx.Data["CanForkRepo"] = false + ctx.Flash.Error(ctx.Tr("repo.fork_no_valid_owners"), true) return nil } @@ -194,8 +192,7 @@ func Fork(ctx *context.Context) { } else { maxCreationLimit := ctx.Doer.MaxCreationLimit() msg := ctx.TrN(maxCreationLimit, "repo.form.reach_limit_of_creation_1", "repo.form.reach_limit_of_creation_n", maxCreationLimit) - ctx.Data["Flash"] = ctx.Flash - ctx.Flash.Error(msg) + ctx.Flash.Error(msg, true) } getForkRepository(ctx) |