mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
8698458f48
commit
0a7d3ff786
145 changed files with 360 additions and 369 deletions
|
@ -83,7 +83,7 @@ func checkContextUser(ctx *context.Context, uid int64) *user_model.User {
|
|||
return ctx.Doer
|
||||
}
|
||||
|
||||
org, err := user_model.GetUserByID(uid)
|
||||
org, err := user_model.GetUserByID(ctx, uid)
|
||||
if user_model.IsErrUserNotExist(err) {
|
||||
return ctx.Doer
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ func Create(ctx *context.Context) {
|
|||
ctx.Data["repo_template_name"] = ctx.Tr("repo.template_select")
|
||||
templateID := ctx.FormInt64("template_id")
|
||||
if templateID > 0 {
|
||||
templateRepo, err := repo_model.GetRepositoryByID(templateID)
|
||||
templateRepo, err := repo_model.GetRepositoryByID(ctx, templateID)
|
||||
if err == nil && access_model.CheckRepoUnitUser(ctx, templateRepo, ctxUser, unit.TypeCode) {
|
||||
ctx.Data["repo_template"] = templateID
|
||||
ctx.Data["repo_template_name"] = templateRepo.Name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue