mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-21 17:24:10 +00:00
#1067: Deleting users should remove them from collaborator lists
- fix delete user but repository watches are not decreased
This commit is contained in:
parent
33894591a6
commit
466facc009
13 changed files with 175 additions and 109 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue