summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-16 06:38:39 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-16 06:38:39 -0400
commit0754dd2f955c70994753cd18228333ca32ceee72 (patch)
treea19b74c2d4b769046743536b646dc6a90428be27
parentfb960db6afa5fa84e60556f0c7d240b4af165a8d (diff)
downloadgitea-0754dd2f955c70994753cd18228333ca32ceee72.tar.gz
gitea-0754dd2f955c70994753cd18228333ca32ceee72.zip
Add delete all feeds when delete account
-rw-r--r--models/user.go7
-rw-r--r--routers/user/user.go2
-rw-r--r--templates/user/publickey.tmpl2
3 files changed, 8 insertions, 3 deletions
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 @@
<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>