Conversation
… to still appear under the cce minor progress table
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where students who declared a CCE minor did not appear in the CCE Minor Progress table. The solution introduces a new query function that uses left outer joins to include declared minor students even when they have no engagement records yet.
Changes:
- Created
getDeclaredMinorStudentsWithProgress()function that queries declared minor students with their progress data using left outer joins - Updated the controller to merge declared minor students with sustained engagement students for the CCE Minor Progress table
- Modified tests to use the new function and updated test user data
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| app/logic/minor.py | Added new getDeclaredMinorStudentsWithProgress() function to query declared minors with progress using left outer joins |
| app/controllers/admin/minor.py | Updated to use new function and merge declared students with sustained engagement students for display |
| app/templates/admin/cceMinor.html | Changed template variable from sustainedEngagement to cceMinorStudents |
| tests/code/test_minor.py | Updated test to use new function, changed test user from "glek" to "nimelyj", fixed email typo in one location |
| database/test_data.py | Added "glek" user back to test data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tudents_Not_Showing Brings feature branch up to date with recent development changes to prevent merge conflicts.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| summerCase = Case(None, [(CCEMinorProposal.proposalType == "Summer Experience", 1)], 0) | ||
|
|
||
| q = ( | ||
| User | ||
| .select( | ||
| User, | ||
| fn.COUNT(fn.DISTINCT(IndividualRequirement.id)).alias("rawEngagementCount"), | ||
| fn.COALESCE(fn.SUM(fn.DISTINCT(summerCase)), 0).alias("summerCount"), |
There was a problem hiding this comment.
The use of fn.SUM(fn.DISTINCT(summerCase)) is problematic. The DISTINCT function operates on the entire expression, not on individual CCEMinorProposal records. Since the Case expression evaluates to either 1 or 0 for each row, DISTINCT will only see unique values of 1 or 0, which means if a student has multiple summer experiences, the sum might only count 1 instead of the actual count. This could lead to incorrect summer experience counts. Consider using fn.COUNT(fn.DISTINCT(Case(None, [(CCEMinorProposal.proposalType == "Summer Experience", CCEMinorProposal.id)], None))) or a simpler approach with filtering.
| summerCase = Case(None, [(CCEMinorProposal.proposalType == "Summer Experience", 1)], 0) | |
| q = ( | |
| User | |
| .select( | |
| User, | |
| fn.COUNT(fn.DISTINCT(IndividualRequirement.id)).alias("rawEngagementCount"), | |
| fn.COALESCE(fn.SUM(fn.DISTINCT(summerCase)), 0).alias("summerCount"), | |
| summerCase = Case( | |
| None, | |
| [(CCEMinorProposal.proposalType == "Summer Experience", CCEMinorProposal.id)], | |
| None, | |
| ) | |
| q = ( | |
| User | |
| .select( | |
| User, | |
| fn.COUNT(fn.DISTINCT(IndividualRequirement.id)).alias("rawEngagementCount"), | |
| fn.COALESCE(fn.COUNT(fn.DISTINCT(summerCase)), 0).alias("summerCount"), |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Comments from PR review have been resolved |
JohnCox2211
left a comment
There was a problem hiding this comment.
You have addressed all of the comments that I left and the your implementation to solve the original issue works well, good work.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Issue Description
Fixes #1660
Changes
Testing
The student has been declared
Student shows up on the CCE Minor Progress Table