diff options
author | Unknwon <u@gogs.io> | 2017-06-21 17:41:18 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-06-21 17:41:18 -0400 |
commit | 11b1498a6e7e01c32d7d802e4d149393b4efb9a9 (patch) | |
tree | ad308322185e34a7e8e0af78a8a163181269bb68 /routes | |
parent | f59500a90bd688f99cde8820274807a581eead25 (diff) |
api/repo: load attributes when listing user repositories (#4565)
Diffstat (limited to 'routes')
-rw-r--r-- | routes/api/v1/repo/repo.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/routes/api/v1/repo/repo.go b/routes/api/v1/repo/repo.go index 8410dcca..c3fcb093 100644 --- a/routes/api/v1/repo/repo.go +++ b/routes/api/v1/repo/repo.go @@ -101,6 +101,12 @@ func listUserRepositories(c *context.APIContext, username string) { return } + if err = models.RepositoryList(ownRepos).LoadAttributes(); err != nil { + c.Error(500, "LoadAttributes(ownRepos)", err) + return + } + + // Early return for querying other user's repositories if c.User.ID != user.ID { repos := make([]*api.Repository, len(ownRepos)) for i := range ownRepos { |