]> source.dussan.org Git - gitea.git/commitdiff
Bug fix
authorUnknown <joe2010xtmf@163.com>
Wed, 7 May 2014 21:23:02 +0000 (17:23 -0400)
committerUnknown <joe2010xtmf@163.com>
Wed, 7 May 2014 21:23:02 +0000 (17:23 -0400)
models/issue.go
models/repo.go
models/user.go
modules/mailer/mail.go

index b93989435a73bd55111f5c6afd1759badb84b68f..f052730059b47f72542b4bb6731b95aa2ef0de28 100644 (file)
@@ -174,15 +174,15 @@ func NewIssueUserPairs(rid, iid, oid, uid, aid int64) (err error) {
                }
 
                // In case owner is not watching.
-               ws = append(ws, &Watch{Uid: id})
+               ws = append(ws, &Watch{UserId: id})
        }
 
        for _, w := range ws {
-               if w.Uid == 0 {
+               if w.UserId == 0 {
                        continue
                }
 
-               iu.Uid = w.Uid
+               iu.Uid = w.UserId
                iu.IsPoster = iu.Uid == uid
                iu.IsAssigned = iu.Uid == aid
                if _, err = orm.Insert(iu); err != nil {
index d187349921598d04bcf28fd305b7157a33a2e09a..1867b990389ecea1f133eb5bd9ca9fab04406ed6 100644 (file)
@@ -725,14 +725,14 @@ func GetCollaborators(repoName string) ([]string, error) {
 // Watch is connection request for receiving repository notifycation.
 type Watch struct {
        Id     int64
-       Uid    int64 `xorm:"UNIQUE(watch)"`
+       UserId int64 `xorm:"UNIQUE(watch)"`
        RepoId int64 `xorm:"UNIQUE(watch)"`
 }
 
 // Watch or unwatch repository.
 func WatchRepo(uid, rid int64, watch bool) (err error) {
        if watch {
-               if _, err = orm.Insert(&Watch{RepoId: rid, Uid: uid}); err != nil {
+               if _, err = orm.Insert(&Watch{RepoId: rid, UserId: uid}); err != nil {
                        return err
                }
 
@@ -770,12 +770,12 @@ func NotifyWatchers(act *Action) error {
        }
 
        for i := range watches {
-               if act.ActUserId == watches[i].Uid {
+               if act.ActUserId == watches[i].UserId {
                        continue
                }
 
                act.Id = 0
-               act.UserId = watches[i].Uid
+               act.UserId = watches[i].UserId
                if _, err = orm.InsertOne(act); err != nil {
                        return errors.New("repo.NotifyWatchers(create action): " + err.Error())
                }
index 9ffdf8e6aefd8f9960b571e2456639631ad4cdbc..b2b16f11365937a5a4e7598997480e0d02cc12c6 100644 (file)
@@ -304,7 +304,7 @@ func DeleteUser(user *User) error {
        }
 
        // Delete all watches.
-       if _, err = orm.Delete(&Watch{Uid: user.Id}); err != nil {
+       if _, err = orm.Delete(&Watch{UserId: user.Id}); err != nil {
                return err
        }
 
index 93ec1153f081c586dcaf1e63f2609d5442b51680..2537c66b5de49f73e058a36b90537617cf9aa501 100644 (file)
@@ -121,7 +121,7 @@ func SendIssueNotifyMail(user, owner *models.User, repo *models.Repository, issu
 
        tos := make([]string, 0, len(ws))
        for i := range ws {
-               uid := ws[i].Uid
+               uid := ws[i].UserId
                if user.Id == uid {
                        continue
                }