mirror of
https://github.com/gogs/gogs.git
synced 2026-01-22 15:22:33 +01:00
user/settings: fix bad error handle of leave organization
This commit is contained in:
@@ -442,11 +442,13 @@ func SettingsOrganizations(ctx *context.Context) {
|
||||
|
||||
func SettingsLeaveOrganization(ctx *context.Context) {
|
||||
err := models.RemoveOrgUser(ctx.QueryInt64("id"), ctx.User.ID)
|
||||
if models.IsErrLastOrgOwner(err) {
|
||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||
} else {
|
||||
ctx.Handle(500, "RemoveOrgUser", err)
|
||||
return
|
||||
if err != nil {
|
||||
if models.IsErrLastOrgOwner(err) {
|
||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||
} else {
|
||||
ctx.Handle(500, "RemoveOrgUser", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ctx.JSON(200, map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user