Browse Source

Add delete all feeds when delete account

pull/31/head
Unknown 11 years ago
parent
commit
0754dd2f95
  1. 7
      models/user.go
  2. 2
      routers/user/user.go
  3. 2
      templates/user/publickey.tmpl

7
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

2
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 (

2
templates/user/publickey.tmpl

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

Loading…
Cancel
Save