aboutsummaryrefslogtreecommitdiff
path: root/models/action.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-22 00:50:47 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-22 00:50:47 +0800
commit17da2fd2e30e85909394bc58069ecab14d8d8577 (patch)
treed80e786818d20aed12b7a84f6a9961468a7f70ec /models/action.go
parentefdaf6ee1536f043d9e242dc16a096c99ec1bfda (diff)
parentf219ddcf4ef13b9d5de129da4eb2b56dbc899d61 (diff)
merged
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 b3be0935..107d4b10 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,