Add delete all feeds when delete account
This commit is contained in:
parent
fb960db6af
commit
0754dd2f95
3 changed files with 8 additions and 3 deletions
|
@ -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…
Reference in a new issue