aboutsummaryrefslogtreecommitdiff
path: root/models/action.go
diff options
context:
space:
mode:
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,