From c1eb4d894a092aed1b87ddf5f80ee824fd56789d Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 5 May 2014 13:08:01 -0400 Subject: Clean api code --- routers/dashboard.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'routers/dashboard.go') diff --git a/routers/dashboard.go b/routers/dashboard.go index 71bdcc9f13..78533127fd 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -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 -- cgit v1.2.3