diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-07 17:37:09 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-07 17:37:09 -0400 |
commit | abd8c2a7ca040966f442c3c3e4b532f00b334ed3 (patch) | |
tree | e61397324154c89883df49a73d94b84064df8481 /models | |
parent | e05b1385fb093fbde1a6248a1f548f778fb09d09 (diff) | |
download | gitea-abd8c2a7ca040966f442c3c3e4b532f00b334ed3.tar.gz gitea-abd8c2a7ca040966f442c3c3e4b532f00b334ed3.zip |
Bug fix
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/repo.go b/models/repo.go index 1867b99038..bdfe909cfb 100644 --- a/models/repo.go +++ b/models/repo.go @@ -725,8 +725,8 @@ func GetCollaborators(repoName string) ([]string, error) { // Watch is connection request for receiving repository notifycation. type Watch struct { Id int64 - UserId int64 `xorm:"UNIQUE(watch)"` - RepoId int64 `xorm:"UNIQUE(watch)"` + UserId int64 `xorm:"UNIQUE(s)"` + RepoId int64 `xorm:"UNIQUE(s)"` } // Watch or unwatch repository. @@ -739,7 +739,7 @@ func WatchRepo(uid, rid int64, watch bool) (err error) { rawSql := "UPDATE `repository` SET num_watches = num_watches + 1 WHERE id = ?" _, err = orm.Exec(rawSql, rid) } else { - if _, err = orm.Delete(&Watch{0, rid, uid}); err != nil { + if _, err = orm.Delete(&Watch{0, uid, rid}); err != nil { return err } rawSql := "UPDATE `repository` SET num_watches = num_watches - 1 WHERE id = ?" |