forked from forgejo/forgejo
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
This commit is contained in:
parent
d81e31ad78
commit
fd7d83ace6
232 changed files with 1463 additions and 2108 deletions
|
@ -66,7 +66,7 @@ func SettingsPost(ctx *context.Context) {
|
|||
|
||||
// Check if organization name has been changed.
|
||||
if org.LowerName != strings.ToLower(form.Name) {
|
||||
isExist, err := user_model.IsUserExist(org.ID, form.Name)
|
||||
isExist, err := user_model.IsUserExist(ctx, org.ID, form.Name)
|
||||
if err != nil {
|
||||
ctx.ServerError("IsUserExist", err)
|
||||
return
|
||||
|
@ -110,7 +110,7 @@ func SettingsPost(ctx *context.Context) {
|
|||
visibilityChanged := form.Visibility != org.Visibility
|
||||
org.Visibility = form.Visibility
|
||||
|
||||
if err := user_model.UpdateUser(org.AsUser(), false); err != nil {
|
||||
if err := user_model.UpdateUser(ctx, org.AsUser(), false); err != nil {
|
||||
ctx.ServerError("UpdateUser", err)
|
||||
return
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ func Webhooks(ctx *context.Context) {
|
|||
ctx.Data["BaseLinkNew"] = ctx.Org.OrgLink + "/settings/hooks"
|
||||
ctx.Data["Description"] = ctx.Tr("org.settings.hooks_desc")
|
||||
|
||||
ws, err := webhook.ListWebhooksByOpts(&webhook.ListWebhookOptions{OrgID: ctx.Org.Organization.ID})
|
||||
ws, err := webhook.ListWebhooksByOpts(ctx, &webhook.ListWebhookOptions{OrgID: ctx.Org.Organization.ID})
|
||||
if err != nil {
|
||||
ctx.ServerError("GetWebhooksByOrgId", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue