changes in new-allocation-card - #654
Open
conwelld wants to merge 35 commits into
Open
Conversation
fritzj2
requested changes
Jul 21, 2026
fritzj2
reviewed
Jul 21, 2026
Author
|
Thanks for looking into this. I have fixed the comments you have made (removed code from other branches and added comments to logic) |
fritzj2
reviewed
Jul 21, 2026
fritzj2
requested changes
Jul 21, 2026
Contributor
|
No logic file and tests needed yet because the logic related to pulling allocations and allocation utilization will be standardized by another team, whereupon this will have to be modified to use those functions. |
…everything touching the 202500
…rvice. See #657 but beyond that we created allo files
MImran2002
requested changes
Jul 22, 2026
MImran2002
requested changes
Aug 4, 2026
MImran2002
requested changes
Aug 4, 2026
…SoftwareDevTeam/lsf into new-allocation-card # Conflicts: # database/demo_data.py
getDepartmentAllocationSummary now calls allocationManager's getTotalAllocations/getContractedAllocations instead of reimplementing the same counts, removing countWorkers/getBreakHours and the manual Allocation SUM query. Falls back to zeroed defaults for a most-recent term that only has a draft allocation (no final row yet), and coalesces getContractedAllocations' break_hours since its SQL SUM() can return None. Updated test_getAllocation.py to match: removed the now-redundant countWorkers/ getBreakHours unit tests, updated the multi-row-allocation expectation to reflect final-only summing, and added coverage for the draft-only fallback.
database/demo_data.py called LaborReleaseForm.insert(...) but never imported the model, so any fresh database/reset_database.sh run failed with a NameError partway through seeding demo data. Pre-existing bug from the department-portal-base merge, unrelated to the allocation card changes.
…llocation Root cause: allocationManager's getContractedAllocations called getAllocation (isFinal=True only) for a value it never used, so any department whose most recent term only has a draft (not yet final) Allocation row raised DoesNotExist. getAllocation.py's earlier try/except caught that and fell back to zeroed defaults, which is why real demo data (departments with only draft allocations) started rendering 0s instead of their actual numbers. - allocationManager.py: removed the dead getAllocation() call from getContractedAllocations. Also folded its break-hours query to filter by department directly in SQL instead of fetching every department's totals and picking the first match after grouping by (department, termCode) - that grouping meant a department with approved break hours under both the specific term and the academic-year "00" bucket term would silently keep only whichever row came back first instead of summing them. Coalesces the SQL SUM() to 0 instead of leaving it None. - getAllocation.py: "allocated" is now summed directly from the Allocation rows already fetched for the most recent term (draft + final, matching the original pre-refactor behavior) instead of going through getTotalAllocations, which only looks at the final row. Dropped the DoesNotExist fallback - no longer needed now that the crash source is fixed at the root. - Updated test_getAllocation.py's multi-row and draft-only cases to expect the correct summed/draft values instead of the zeroed fallback. - Added two regression tests to test_allocationManger.py: getContractedAllocations without any Allocation row present, and break hours summed across a specific term and its academic-year bucket term.
munsakad
force-pushed
the
new-allocation-card
branch
from
August 5, 2026 18:53
102ee32 to
77eabdf
Compare
munsakad
force-pushed
the
new-allocation-card
branch
from
August 5, 2026 19:10
77eabdf to
f3b43c6
Compare
MImran2002
requested changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changes
getTerms.pyfor handling current termRationale
getAllocation.pyand its test case.migrate_db_tracy.sh, which were deemed unnecessary for the issueTesting