Fix public activity showing private repos (#892)
* Fix public activity showing private repos (#811) Signed-off-by: Morgan Bazalgette <the@howl.moe> * error check after setting is_private to true * Add test for UpdateRepository w/ visibility change
This commit is contained in:
parent
a36a8f4d72
commit
442145dbd3
5 changed files with 67 additions and 0 deletions
|
@ -1408,6 +1408,16 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
|
|||
}
|
||||
}
|
||||
|
||||
// If repo has become private, we need to set its actions to private.
|
||||
if repo.IsPrivate {
|
||||
_, err = e.Where("repo_id = ?", repo.ID).Cols("is_private").Update(&Action{
|
||||
IsPrivate: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Create/Remove git-daemon-export-ok for git-daemon...
|
||||
daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
|
||||
if repo.IsPrivate && com.IsExist(daemonExportFile) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue