(c *context.Context)
| 573 | } |
| 574 | |
| 575 | func SettingsLeaveOrganization(c *context.Context) { |
| 576 | if err := database.RemoveOrgUser(c.QueryInt64("id"), c.User.ID); err != nil { |
| 577 | if database.IsErrLastOrgOwner(err) { |
| 578 | c.Flash.Error(c.Tr("form.last_org_owner")) |
| 579 | } else { |
| 580 | c.Errorf(err, "remove organization user") |
| 581 | return |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | c.JSONSuccess(map[string]any{ |
| 586 | "redirect": conf.Server.Subpath + "/user/settings/organizations", |
| 587 | }) |
| 588 | } |
| 589 | |
| 590 | func (h *SettingsHandler) Applications() macaron.Handler { |
| 591 | return func(c *context.Context) { |
nothing calls this directly
no test coverage detected