-
Notifications
You must be signed in to change notification settings - Fork 287
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
fixes #7697 - enable searching by CVE #4836
Conversation
end | ||
|
||
def find_cve | ||
@cve = params[:cve] |
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'd probably check the id, eg:
def find_cve
@cve = ErratumCve.find_by_id(params[:cve])
fail HttpErrors::NotFound, _("Could not find erratum CVE with id '%s'") % params[:cve] unless @cve
end
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.
Yea, I had that originally, I wasn't sure if it was worth the double SQL query (and cve_id isn't unique), but will add it
ACK pending small comment |
@daviddavis Can you just sanity check this? I think I need to do this to verify it, as an errata can have many CVE's, and def find_cve
@cve = params[:cve] if ErratumCve.where(:cve_id => params[:cve]).any?
fail HttpErrors::NotFound, _("Could not find erratum with CVE '%s'") % params[:cve] unless @cve
end |
Sorry, I didn't realize the cve id wasn't a primary key. In that case I might keep it the way it was before. My bad. I would probably just remove the |
[test] |
APJ |
[test] |
1 similar comment
[test] |
fixes #7697 - enable searching by CVE
No description provided.