diff --git a/routers/user/profile.go b/routers/user/profile.go index 0e29b6117..fe5dc4598 100755 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -6,6 +6,7 @@ package user import ( + "errors" "fmt" "path" "strings" @@ -107,6 +108,9 @@ func Profile(ctx *context.Context) { ctx.Data["HasOrgsVisible"] = models.HasOrgsVisible(orgs, ctx.User) tab := ctx.Query("tab") + if tab == "" { + tab = "activity" + } ctx.Data["TabName"] = tab page := ctx.QueryInt("page") @@ -230,7 +234,7 @@ func Profile(ctx *context.Context) { } total = int(count) ctx.Data["Datasets"] = datasets - default: + case "repository": repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ ListOptions: models.ListOptions{ PageSize: setting.UI.User.RepoPagingNum, @@ -251,6 +255,9 @@ func Profile(ctx *context.Context) { } total = int(count) + default: + ctx.ServerError("tab error", errors.New("tab error")) + return } ctx.Data["Repos"] = repos ctx.Data["Total"] = total