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

Ensure params are passed as keyword arguments to database queries #7040

Merged

Conversation

david-yz-liu
Copy link
Contributor

@david-yz-liu david-yz-liu commented Apr 28, 2024

Motivation and Context

Three issues reported by GitHub's CodeQL:

These are false positives in that we use permit! to ensure correct structure and whitelisting of the user params. However, I've modified the code to not just pass in the filtered params directly.

Your Changes

Description: Extract the single relevant param (course_id) in one case; use the double splat operator in the other two cases.

Type of change (select all that apply):

  • Refactoring (internal change to codebase, without changing functionality)

Testing

Tested manually and by running the test suite.

Questions and Comments (if applicable)

Checklist

  • I have performed a self-review of my own code.
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported on Coveralls.
  • I have updated the Changelog.md file.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 8870972819

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 91.476%

Totals Coverage Status
Change from base Build 8862784121: 0.001%
Covered Lines: 39852
Relevant Lines: 42900

💛 - Coveralls

@donny-wong donny-wong requested review from pretendWhale and removed request for donny-wong May 1, 2024 12:47
@pretendWhale pretendWhale merged commit ed0007b into MarkUsProject:master May 2, 2024
6 checks passed
@david-yz-liu david-yz-liu deleted the fix-params-passing-to-where branch August 9, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants