From cca2a53d6f756ac9adee2570703558a545ec2f1f Mon Sep 17 00:00:00 2001 From: Michael Litvak Date: Tue, 13 May 2014 23:37:09 +0300 Subject: [PATCH] Fix issue link in issues page The link assumes that the issue belongs to the signed in user, which is not necessarily the case I changed it to use repository owner name instead --- routers/user/home.go | 6 ++++++ templates/issue/user.tmpl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/routers/user/home.go b/routers/user/home.go index 0a805903e..b19f3ff4a 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -235,6 +235,12 @@ func Issues(ctx *middleware.Context) { return } + err = issues[i].Repo.GetOwner() + if err != nil { + ctx.Handle(500, "user.Issues(GetOwner)", err) + return + } + issues[i].Poster, err = models.GetUserById(issues[i].PosterId) if err != nil { ctx.Handle(500, "user.Issues(GetUserById)", err) diff --git a/templates/issue/user.tmpl b/templates/issue/user.tmpl index f480c63a8..d1c2bd994 100644 --- a/templates/issue/user.tmpl +++ b/templates/issue/user.tmpl @@ -36,7 +36,7 @@ {{range .Issues}}{{if .}}
#{{.Index}} -
{{.Name}}
+
{{.Name}}

{{.Poster.Name}}