1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-03 00:45:22 +02:00

Fix not removed watches on unallowed repositories (#4201)

This commit is contained in:
David Schneiderbauer 2018-06-19 21:44:33 +02:00 committed by techknowlogick
parent 467ff4d343
commit a93f13849c
6 changed files with 233 additions and 0 deletions

View file

@ -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()
}