summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-21 01:09:22 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-21 01:09:22 -0400
commit369ddf76a8ae6916ab72f1fa26c81b44c456c6ea (patch)
tree3e26392ef3ff4569cc077432e507e848f907df8a /models/action.go
parent53a17bbd240e0dd3755b7a666792d69e358f3e00 (diff)
downloadgitea-369ddf76a8ae6916ab72f1fa26c81b44c456c6ea.tar.gz
gitea-369ddf76a8ae6916ab72f1fa26c81b44c456c6ea.zip
Batch fix
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/action.go b/models/action.go
index b3be093533..107d4b1057 100644
--- a/models/action.go
+++ b/models/action.go
@@ -64,6 +64,10 @@ func CommitRepoAction(userId int64, userName string,
watches = append(watches, Watch{UserId: userId})
for i := range watches {
+ if userId == watches[i].UserId && i > 0 {
+ continue // Do not add twice in case author watches his/her repository.
+ }
+
_, err = orm.InsertOne(&Action{
UserId: watches[i].UserId,
ActUserId: userId,