diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-07-05 05:47:05 +0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-07-05 00:47:05 +0300 |
commit | b46066f17c79b4b4196a61e710120d874af6ee5a (patch) | |
tree | 66185d6c90d53e82e321eb4a3ed2b4035eb3fbad /models | |
parent | 95f0f62ea40b7b0419607e9e918f329981bcafb7 (diff) | |
download | gitea-b46066f17c79b4b4196a61e710120d874af6ee5a.tar.gz gitea-b46066f17c79b4b4196a61e710120d874af6ee5a.zip |
fix repository last updated time update when delete a user who watched the repo (#4363)
Diffstat (limited to 'models')
-rw-r--r-- | models/user.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/user.go b/models/user.go index 5ac8658796..0b7af8df6d 100644 --- a/models/user.go +++ b/models/user.go @@ -956,7 +956,7 @@ func deleteUser(e *xorm.Session, u *User) error { Where("watch.user_id = ?", u.ID).Find(&watchedRepoIDs); err != nil { return fmt.Errorf("get all watches: %v", err) } - if _, err = e.Decr("num_watches").In("id", watchedRepoIDs).Update(new(Repository)); err != nil { + if _, err = e.Decr("num_watches").In("id", watchedRepoIDs).NoAutoTime().Update(new(Repository)); err != nil { return fmt.Errorf("decrease repository num_watches: %v", err) } // ***** END: Watch ***** @@ -966,7 +966,7 @@ func deleteUser(e *xorm.Session, u *User) error { if err = e.Table("star").Cols("star.repo_id"). Where("star.uid = ?", u.ID).Find(&starredRepoIDs); err != nil { return fmt.Errorf("get all stars: %v", err) - } else if _, err = e.Decr("num_stars").In("id", starredRepoIDs).Update(new(Repository)); err != nil { + } else if _, err = e.Decr("num_stars").In("id", starredRepoIDs).NoAutoTime().Update(new(Repository)); err != nil { return fmt.Errorf("decrease repository num_stars: %v", err) } // ***** END: Star ***** |