summaryrefslogtreecommitdiffstats
path: root/routers/dashboard.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-05 13:08:01 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-05 13:08:01 -0400
commitc1eb4d894a092aed1b87ddf5f80ee824fd56789d (patch)
treeb58beee7c762cbbb1cec524c16471788820609b6 /routers/dashboard.go
parent5f653898f3b39669ce9dbf0ee2263c391695019d (diff)
downloadgitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.tar.gz
gitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.zip
Clean api code
Diffstat (limited to 'routers/dashboard.go')
-rw-r--r--routers/dashboard.go14
1 files changed, 12 insertions, 2 deletions
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