Fix "Flash" message usage (#25895)
Resolve https://github.com/go-gitea/gitea/pull/25820/files#r1264309059
This commit is contained in:
parent
faf28b2823
commit
9672085d94
2 changed files with 6 additions and 23 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue