1
0
Fork 0
forked from forgejo/forgejo

Clean api code

This commit is contained in:
Unknown 2014-05-05 13:08:01 -04:00
parent 5f653898f3
commit c1eb4d894a
20 changed files with 277 additions and 121 deletions

View file

@ -24,9 +24,19 @@ func Home(ctx *middleware.Context) {
return
}
repos, _ := models.GetRecentUpdatedRepositories()
// Show recent updated repositoires for new visiters.
repos, err := models.GetRecentUpdatedRepositories()
if err != nil {
ctx.Handle(500, "dashboard.Home(GetRecentUpdatedRepositories)", err)
return
}
for _, repo := range repos {
repo.Owner, _ = models.GetUserById(repo.OwnerId)
repo.Owner, err = models.GetUserById(repo.OwnerId)
if err != nil {
ctx.Handle(500, "dashboard.Home(GetUserById)", err)
return
}
}
ctx.Data["Repos"] = repos
ctx.Data["PageIsHome"] = true