Add delete all feeds when delete account

tokarchuk/v1.17
Unknown 11 years ago
parent fb960db6af
commit 0754dd2f95
  1. 7
      models/user.go
  2. 2
      routers/user/user.go
  3. 2
      templates/user/publickey.tmpl

@ -152,7 +152,12 @@ func DeleteUser(user *User) error {
// TODO: check issues, other repos' commits // 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) keys := make([]PublicKey, 0, 10)
if err = orm.Find(&keys, &PublicKey{OwnerId: user.Id}); err != nil { if err = orm.Find(&keys, &PublicKey{OwnerId: user.Id}); err != nil {
return err return err

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

@ -5,7 +5,7 @@
<h4>Account Setting</h4> <h4>Account Setting</h4>
<ul class="list-group"> <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">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"><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 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> <li class="list-group-item"><a href="/user/setting/security">Security</a></li>

Loading…
Cancel
Save