aboutsummaryrefslogtreecommitdiffstats
path: root/routers/org/setting.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-17 21:51:39 -0400
committerUnknwon <u@gogs.io>2015-03-17 21:51:39 -0400
commit466facc0097bf636b6a945a0daebb7c4c5c33c91 (patch)
tree614c2782ff5b59dd40cea9a9caadb93d46570258 /routers/org/setting.go
parent33894591a6d391674e938d018801d88d0011f0b7 (diff)
downloadgitea-466facc0097bf636b6a945a0daebb7c4c5c33c91.tar.gz
gitea-466facc0097bf636b6a945a0daebb7c4c5c33c91.zip
#1067: Deleting users should remove them from collaborator lists
- fix delete user but repository watches are not decreased
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 {