mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 01:45:22 +02:00
Penultimate round of db.DefaultContext
refactor (#27414)
Part of #27065 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
50166d1f7c
commit
ebe803e514
136 changed files with 428 additions and 421 deletions
|
@ -90,7 +90,7 @@ func NewUser(ctx *context.Context) {
|
|||
|
||||
ctx.Data["login_type"] = "0-0"
|
||||
|
||||
sources, err := auth.Sources()
|
||||
sources, err := auth.Sources(ctx)
|
||||
if err != nil {
|
||||
ctx.ServerError("auth.Sources", err)
|
||||
return
|
||||
|
@ -109,7 +109,7 @@ func NewUserPost(ctx *context.Context) {
|
|||
ctx.Data["DefaultUserVisibilityMode"] = setting.Service.DefaultUserVisibilityMode
|
||||
ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()
|
||||
|
||||
sources, err := auth.Sources()
|
||||
sources, err := auth.Sources(ctx)
|
||||
if err != nil {
|
||||
ctx.ServerError("auth.Sources", err)
|
||||
return
|
||||
|
@ -221,7 +221,7 @@ func prepareUserInfo(ctx *context.Context) *user_model.User {
|
|||
ctx.Data["User"] = u
|
||||
|
||||
if u.LoginSource > 0 {
|
||||
ctx.Data["LoginSource"], err = auth.GetSourceByID(u.LoginSource)
|
||||
ctx.Data["LoginSource"], err = auth.GetSourceByID(ctx, u.LoginSource)
|
||||
if err != nil {
|
||||
ctx.ServerError("auth.GetSourceByID", err)
|
||||
return nil
|
||||
|
@ -230,7 +230,7 @@ func prepareUserInfo(ctx *context.Context) *user_model.User {
|
|||
ctx.Data["LoginSource"] = &auth.Source{}
|
||||
}
|
||||
|
||||
sources, err := auth.Sources()
|
||||
sources, err := auth.Sources(ctx)
|
||||
if err != nil {
|
||||
ctx.ServerError("auth.Sources", err)
|
||||
return nil
|
||||
|
@ -532,7 +532,7 @@ func DeleteAvatar(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if err := user_service.DeleteAvatar(u); err != nil {
|
||||
if err := user_service.DeleteAvatar(ctx, u); err != nil {
|
||||
ctx.Flash.Error(err.Error())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue