-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bug on issue view when not login #1624
Conversation
routers/repo/issue.go
Outdated
IsWatching: models.IsWatching(ctx.User.ID, ctx.Repo.Repository.ID), | ||
} | ||
} | ||
} else { | ||
iw = &models.IssueWatch{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer that iw would stay at nil
and in template https://github.com/go-gitea/gitea/blob/master/templates/repo/issue/view_content/sidebar.tmpl#L104 the form is only display if logged or/and IssueWatch is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
LGTM |
LGTM |
@lunny Builds fail though 😢 |
@lunny |
integrations/issue_test.go
Outdated
func TestNoLoginViewIssue(t *testing.T) { | ||
assert.NoError(t, models.LoadFixtures()) | ||
|
||
req, err := http.NewRequest("GET", "/user1/repo1/issues/1", nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repo1 is owned by user2 (https://github.com/go-gitea/gitea/blob/master/models/fixtures/repository.yml) -> so /user2/repo1/issues/
Ref :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confusing there are two fixtures. https://github.com/go-gitea/gitea/blob/master/models/fixtures
and integrations/gitea-integration/fixtures
,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your test you seem to load "code.gitea.io/gitea/models".LoadFixtures()
don't know for the other fixture.
waiting #1627 |
Good idea of removing duplicate fixture. |
78a21a9
to
6477e37
Compare
let L-G-T-M work |
will fix #1539