diff --git a/models/user.go b/models/user.go index ffeb72525d..463d4a271f 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 e13f6909dd..b87076d9e8 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 b671f63fdb..3b2cc1128f 100644 --- a/templates/user/publickey.tmpl +++ b/templates/user/publickey.tmpl @@ -5,7 +5,7 @@