summaryrefslogtreecommitdiffstats
path: root/routers/org/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/org/setting.go')
-rw-r--r--routers/org/setting.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/org/setting.go b/routers/org/setting.go
index c638a032e7..8bc6a2a96a 100644
--- a/routers/org/setting.go
+++ b/routers/org/setting.go
@@ -87,13 +87,12 @@ func SettingsDelete(ctx *middleware.Context) {
org := ctx.Org.Organization
if ctx.Req.Method == "POST" {
- // TODO: validate password.
+ // FIXME: validate password.
if err := models.DeleteOrganization(org); err != nil {
- switch err {
- case models.ErrUserOwnRepos:
+ if models.IsErrUserOwnRepos(err) {
ctx.Flash.Error(ctx.Tr("form.org_still_own_repo"))
ctx.Redirect(setting.AppSubUrl + "/org/" + org.LowerName + "/settings/delete")
- default:
+ } else {
ctx.Handle(500, "DeleteOrganization", err)
}
} else {