diff options
author | David Schneiderbauer <daviian@users.noreply.github.com> | 2018-06-19 21:44:33 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@users.noreply.github.com> | 2018-06-19 15:44:33 -0400 |
commit | a93f13849cd7f54029f1dc17b642d024b98ee71e (patch) | |
tree | 99340a1daec2fa3a3db14ed630b57c6bc3984fbe /models/repo_collaboration.go | |
parent | 467ff4d34302f6ecab959d61bf3944a2bdf125d0 (diff) | |
download | gitea-a93f13849cd7f54029f1dc17b642d024b98ee71e.tar.gz gitea-a93f13849cd7f54029f1dc17b642d024b98ee71e.zip |
Fix not removed watches on unallowed repositories (#4201)
Diffstat (limited to 'models/repo_collaboration.go')
-rw-r--r-- | models/repo_collaboration.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/models/repo_collaboration.go b/models/repo_collaboration.go index 0448149e6a..9d2935d581 100644 --- a/models/repo_collaboration.go +++ b/models/repo_collaboration.go @@ -172,5 +172,14 @@ func (repo *Repository) DeleteCollaboration(uid int64) (err error) { return err } + if err = watchRepo(sess, uid, repo.ID, false); err != nil { + return err + } + + // Remove all IssueWatches a user has subscribed to in the repository + if err := removeIssueWatchersByRepoID(sess, uid, repo.ID); err != nil { + return err + } + return sess.Commit() } |