1
0
Fork 0

Add delete all feeds when delete account

This commit is contained in:
Unknown 2014-03-16 06:38:39 -04:00
parent fb960db6af
commit 0754dd2f95
3 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -168,7 +168,7 @@ func Delete(ctx *middleware.Context) {
}
}
ctx.Render.HTML(200, "user/delete", ctx.Data)
ctx.Render.Redirect("/", 302)
}
const (

View file

@ -5,7 +5,7 @@
<h4>Account Setting</h4>
<ul class="list-group">
<li class="list-group-item"><a href="/user/setting">Account Profile</a></li>
<li class="list-group-item"><a href="/user/setting/Password">Password</a></li>
<li class="list-group-item"><a href="/user/setting/password">Password</a></li>
<li class="list-group-item"><a href="/user/setting/notification">Notifications</a></li>
<li class="list-group-item list-group-item-success"><a href="/user/setting/ssh/">SSH Keys</a></li>
<li class="list-group-item"><a href="/user/setting/security">Security</a></li>