mirror of https://github.com/gogs/gogs.git
user/settings: fix bad error handle of leave organization
parent
8f52ab8201
commit
78f94986e3
|
@ -442,11 +442,13 @@ func SettingsOrganizations(ctx *context.Context) {
|
||||||
|
|
||||||
func SettingsLeaveOrganization(ctx *context.Context) {
|
func SettingsLeaveOrganization(ctx *context.Context) {
|
||||||
err := models.RemoveOrgUser(ctx.QueryInt64("id"), ctx.User.ID)
|
err := models.RemoveOrgUser(ctx.QueryInt64("id"), ctx.User.ID)
|
||||||
if models.IsErrLastOrgOwner(err) {
|
if err != nil {
|
||||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
if models.IsErrLastOrgOwner(err) {
|
||||||
} else {
|
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||||
ctx.Handle(500, "RemoveOrgUser", err)
|
} else {
|
||||||
return
|
ctx.Handle(500, "RemoveOrgUser", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.JSON(200, map[string]interface{}{
|
ctx.JSON(200, map[string]interface{}{
|
||||||
|
|
Loading…
Reference in New Issue