Skip to content
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

Merged
merged 4 commits into from
Apr 29, 2017

Conversation

lunny
Copy link
Member

@lunny lunny commented Apr 27, 2017

will fix #1539

@lunny lunny added the type/bug label Apr 27, 2017
@lunny lunny added this to the 1.2.0 milestone Apr 27, 2017
IsWatching: models.IsWatching(ctx.User.ID, ctx.Repo.Repository.ID),
}
}
} else {
iw = &models.IssueWatch{
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@sapk
Copy link
Member

sapk commented Apr 27, 2017

LGTM

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 27, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Apr 27, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 27, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Apr 27, 2017

@lunny Builds fail though 😢

@sapk
Copy link
Member

sapk commented Apr 27, 2017

@lunny You need to test the creation of a issue before and next try to view this issue.

func TestNoLoginViewIssue(t *testing.T) {
assert.NoError(t, models.LoadFixtures())

req, err := http.NewRequest("GET", "/user1/repo1/issues/1", nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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,

Copy link
Member

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.

@lunny
Copy link
Member Author

lunny commented Apr 27, 2017

waiting #1627

@sapk
Copy link
Member

sapk commented Apr 27, 2017

Good idea of removing duplicate fixture.

@lunny lunny force-pushed the lunny/fix_issue_not_login branch from 78a21a9 to 6477e37 Compare April 28, 2017 14:11
@lunny
Copy link
Member Author

lunny commented Apr 29, 2017

let L-G-T-M work

@lunny lunny merged commit e31c02d into go-gitea:master Apr 29, 2017
@lunny lunny deleted the lunny/fix_issue_not_login branch April 29, 2017 05:52
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic in routers/repo.ViewIssue() when not logged in
5 participants