diff --git a/models/user.go b/models/user.go index ffeb72525..463d4a271 100644 --- a/models/user.go +++ b/models/user.go @@ -152,7 +152,12 @@ func DeleteUser(user *User) error { // TODO: check issues, other repos' commits - // Delete SSH keys. + // Delete all feeds. + if _, err = orm.Delete(&Action{UserId: user.Id}); err != nil { + return err + } + + // Delete all SSH keys. keys := make([]PublicKey, 0, 10) if err = orm.Find(&keys, &PublicKey{OwnerId: user.Id}); err != nil { return err diff --git a/routers/user/user.go b/routers/user/user.go index e13f6909d..b87076d9e 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -168,7 +168,7 @@ func Delete(ctx *middleware.Context) { } } - ctx.Render.HTML(200, "user/delete", ctx.Data) + ctx.Render.Redirect("/", 302) } const ( diff --git a/templates/user/publickey.tmpl b/templates/user/publickey.tmpl index b671f63fd..3b2cc1128 100644 --- a/templates/user/publickey.tmpl +++ b/templates/user/publickey.tmpl @@ -5,7 +5,7 @@