-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 in Issue.GetIsRead #876
Conversation
LGTM |
models/issue.go
Outdated
@@ -193,7 +193,9 @@ func (issue *Issue) GetIsRead(userID int64) error { | |||
if has, err := x.Get(issueUser); err != nil { | |||
return err | |||
} else if !has { | |||
return ErrUserNotExist{UID: userID} | |||
issue.IsRead = false | |||
_, err := x.Insert(&IssueUser{IssueID: issue.ID, UID: userID}) |
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.
It's no need to insert?
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.
issue.IsRead = false
return nil
I think that's enough.
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.
Fixed.
f51b085
to
7c75000
Compare
LGTM |
Fixes bug where a user would get a 500 if they tried to view the issues for a repo with issues they'd never viewed before.