summaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-27 16:39:36 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-27 16:39:36 +0800
commit9baf2b38d025eaf1d9bbb10a4616c71813ea7054 (patch)
treea6b8f31a638f2ca286e2c99e1c43c48e59e9c9c6 /models/org.go
parent50de06056be67ab8433fa796608e38004f2e8733 (diff)
downloadgitea-9baf2b38d025eaf1d9bbb10a4616c71813ea7054.tar.gz
gitea-9baf2b38d025eaf1d9bbb10a4616c71813ea7054.zip
Bug fix on organization
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/models/org.go b/models/org.go
index 5d73cf3ff2..1c74c290e9 100644
--- a/models/org.go
+++ b/models/org.go
@@ -337,6 +337,9 @@ func RemoveOrgUser(orgId, uid int64) error {
if _, err = sess.Delete(access); err != nil {
sess.Rollback()
return err
+ } else if err = WatchRepo(u.Id, repo.Id, false); err != nil {
+ sess.Rollback()
+ return err
}
}
@@ -513,6 +516,10 @@ func (t *Team) AddRepository(repo *Repository) (err error) {
return err
}
}
+ if err = WatchRepo(u.Id, repo.Id, true); err != nil {
+ sess.Rollback()
+ return err
+ }
}
return sess.Commit()
}
@@ -564,6 +571,9 @@ func (t *Team) RemoveRepository(repoId int64) error {
if _, err = sess.Delete(access); err != nil {
sess.Rollback()
return fmt.Errorf("fail to delete access: %v", err)
+ } else if err = WatchRepo(u.Id, repo.Id, false); err != nil {
+ sess.Rollback()
+ return err
}
} else if auth < t.Authorize {
if err = addAccessWithAuthorize(sess, access, AuthorizeToAccessType(auth)); err != nil {
@@ -1029,6 +1039,9 @@ func removeTeamMemberWithSess(orgId, teamId, uid int64, sess *xorm.Session) erro
if _, err = sess.Delete(access); err != nil {
sess.Rollback()
return fmt.Errorf("fail to delete access: %v", err)
+ } else if err = WatchRepo(u.Id, repo.Id, false); err != nil {
+ sess.Rollback()
+ return err
}
} else if auth < t.Authorize {
// Downgrade authorize level.