Code convention
This commit is contained in:
parent
e33a104448
commit
80055bde86
11 changed files with 63 additions and 90 deletions
|
@ -752,14 +752,14 @@ func GetRepositoryById(id int64) (*Repository, error) {
|
|||
}
|
||||
|
||||
// GetRepositories returns a list of repositories of given user.
|
||||
func GetRepositories(user *User, private bool) ([]*Repository, error) {
|
||||
func GetRepositories(uid int64, private bool) ([]*Repository, error) {
|
||||
repos := make([]*Repository, 0, 10)
|
||||
sess := orm.Desc("updated")
|
||||
if !private {
|
||||
sess.Where("is_private=?", false)
|
||||
}
|
||||
|
||||
err := sess.Find(&repos, &Repository{OwnerId: user.Id})
|
||||
err := sess.Find(&repos, &Repository{OwnerId: uid})
|
||||
return repos, err
|
||||
}
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ func ChangeUserName(user *User, newUserName string) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
repos, err := GetRepositories(user, true)
|
||||
repos, err := GetRepositories(user.Id, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue