Skip to content

Commit bafd778

Browse files
ethantkoeniglunny
authored andcommitted
Fix invalid reference in feeds template (#1820)
* Fix invalid reference in feeds template * Comment for GetActAvatar * Add integration test
1 parent 97f7f88 commit bafd778

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

integrations/issue_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ import (
1111
"github.com/stretchr/testify/assert"
1212
)
1313

14+
func TestNoLoginViewIssues(t *testing.T) {
15+
prepareTestEnv(t)
16+
17+
req, err := http.NewRequest("GET", "/user2/repo1/issues", nil)
18+
assert.NoError(t, err)
19+
resp := MakeRequest(req)
20+
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
21+
}
22+
1423
func TestNoLoginViewIssue(t *testing.T) {
1524
prepareTestEnv(t)
1625

models/action.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ func (a *Action) ShortActUserName() string {
142142
return base.EllipsisString(a.GetActUserName(), 20)
143143
}
144144

145+
// GetActAvatar the action's user's avatar link
146+
func (a *Action) GetActAvatar() string {
147+
a.loadActUser()
148+
return a.ActUser.AvatarLink()
149+
}
150+
145151
// GetRepoUserName returns the name of the action repository owner.
146152
func (a *Action) GetRepoUserName() string {
147153
a.loadRepo()

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{range .Feeds}}
22
<div class="news">
33
<div class="ui left">
4-
<img class="ui avatar image" src="{{.ActAvatar}}" alt="">
4+
<img class="ui avatar image" src="{{.GetActAvatar}}" alt="">
55
</div>
66
<div class="ui grid">
77
<div class="ui fifteen wide column">

0 commit comments

Comments
 (0)