1
0
Fork 0
forked from forgejo/forgejo

Clean oauth code

This commit is contained in:
Unknown 2014-04-13 18:12:07 -04:00
parent 8c266f2df5
commit 4b9b8024ba
17 changed files with 547 additions and 748 deletions

View file

@ -714,9 +714,14 @@ func GetRepositoryById(id int64) (*Repository, error) {
}
// GetRepositories returns the list of repositories of given user.
func GetRepositories(user *User) ([]Repository, error) {
func GetRepositories(user *User, private bool) ([]Repository, error) {
repos := make([]Repository, 0, 10)
err := orm.Desc("updated").Find(&repos, &Repository{OwnerId: user.Id})
sess := orm.Desc("updated")
if !private {
sess.Where("is_private=?", false)
}
err := sess.Find(&repos, &Repository{OwnerId: user.Id})
return repos, err
}