1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Replace more db.DefaultContext (#27628)

Target #27065
This commit is contained in:
Lunny Xiao
2023-10-15 23:46:06 +08:00
committed by GitHub
parent 7480aacdad
commit cddf245c12
33 changed files with 99 additions and 85 deletions

View File

@@ -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{