diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-10-15 23:46:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-15 17:46:06 +0200 |
commit | cddf245c12223c783c856c87c21cc796ac425439 (patch) | |
tree | 21edf50797c62c3e70dbada95edc20d7ddfd53b8 /routers/web/org | |
parent | 7480aacdad9470458fa0142beab54b8011bbac25 (diff) | |
download | gitea-cddf245c12223c783c856c87c21cc796ac425439.tar.gz gitea-cddf245c12223c783c856c87c21cc796ac425439.zip |
Replace more db.DefaultContext (#27628)
Target #27065
Diffstat (limited to 'routers/web/org')
-rw-r--r-- | routers/web/org/members.go | 4 | ||||
-rw-r--r-- | routers/web/org/setting.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/org/members.go b/routers/web/org/members.go index 247025a7cb..15a615c706 100644 --- a/routers/web/org/members.go +++ b/routers/web/org/members.go @@ -104,14 +104,14 @@ func MembersAction(ctx *context.Context) { ctx.Error(http.StatusNotFound) return } - err = models.RemoveOrgUser(org.ID, uid) + err = models.RemoveOrgUser(ctx, org.ID, uid) if organization.IsErrLastOrgOwner(err) { ctx.Flash.Error(ctx.Tr("form.last_org_owner")) ctx.JSONRedirect(ctx.Org.OrgLink + "/members") return } case "leave": - err = models.RemoveOrgUser(org.ID, ctx.Doer.ID) + err = models.RemoveOrgUser(ctx, org.ID, ctx.Doer.ID) if err == nil { ctx.Flash.Success(ctx.Tr("form.organization_leave_success", org.DisplayName())) ctx.JSON(http.StatusOK, map[string]any{ diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go index c3eb7ff551..2f2f7c14bd 100644 --- a/routers/web/org/setting.go +++ b/routers/web/org/setting.go @@ -124,7 +124,7 @@ func SettingsPost(ctx *context.Context) { // update forks visibility if visibilityChanged { - repos, _, err := repo_model.GetUserRepositories(&repo_model.SearchRepoOptions{ + repos, _, err := repo_model.GetUserRepositories(ctx, &repo_model.SearchRepoOptions{ Actor: org.AsUser(), Private: true, ListOptions: db.ListOptions{Page: 1, PageSize: org.NumRepos}, }) if err != nil { @@ -180,7 +180,7 @@ func SettingsDelete(ctx *context.Context) { return } - if err := org_service.DeleteOrganization(ctx.Org.Organization); err != nil { + if err := org_service.DeleteOrganization(ctx, ctx.Org.Organization); err != nil { if models.IsErrUserOwnRepos(err) { ctx.Flash.Error(ctx.Tr("form.org_still_own_repo")) ctx.Redirect(ctx.Org.OrgLink + "/settings/delete") |