Skip to content

Adding an Allocation Review & an Allocation Request Pages - #668

Open
ArtemKurasov wants to merge 25 commits into
dep_portal_ad_ManageDepartmentsfrom
Artem-alloc-review
Open

Adding an Allocation Review & an Allocation Request Pages#668
ArtemKurasov wants to merge 25 commits into
dep_portal_ad_ManageDepartmentsfrom
Artem-alloc-review

Conversation

@ArtemKurasov

@ArtemKurasov ArtemKurasov commented Aug 5, 2026

Copy link
Copy Markdown

Issue

Fixes issues #613 and #614

Changes

  • Added an Allocation Request page (can only be accessed via URL currently)
  • Added an Allocation Review page (accessed through Manage Departments > Actions > Review Allocation)
  • Departments can now submit allocation requests, while admins (the Labor Department) can review and approve them
  • Created two new logic functions: getCurrentAndNextYear() and allocationExists()
  • Updated the demo data

Automatic Testing

  • Run pytest tests/code/test_academicYearManager.py and pytest tests/code/test_allocationManger.py to make sure the newly created allocation functions work.

Manual Testing

  • First of all, reset the database (because there were changes to the demo data)
  • Try opening allocation reviews for all departments (you should not be able to open allocation reviews for the Biology and Math departments, because the Biology department have not submitted anything yet, and the Math department has already gotten its allocation approved)
  • Go to the Department Portal, choose a department, and /allocations/request to the end of the URL. You should appear on the Allocation Request page.
  • Change the numbers and submit the request.
  • Go Back to the Manage Departments page, and choose the 2025-2026 academic year. You should see the request appearing there.
  • Go back to the Department Portal, choose the same department, and /allocations/request to the end of the URL.
  • Edit the numbers once again and submit the request.
  • Go Back to the Manage Departments page, and choose the 2025-2026 academic year. You should see the updated request there.
  • Approve the request by submitting the Allocation Review form.
image image

@ArtemKurasov
ArtemKurasov marked this pull request as ready for review August 5, 2026 21:21
@ArtemKurasov ArtemKurasov self-assigned this Aug 5, 2026

# checking if the allocation has already been approved (in other words, if an approved allocation exists)
if allocationExists(nextAY.termCode, dept, isFinal=True):
flash(f"The allocation for the {nextAY.termName.split(" ")[1]} academic year has already been approved; therefore, you can no longer resubmit it.", "danger")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug f string error

from app.logic.academicYearManager import getCurrentAndNextAY


@main_bp.route('/department/<org>/<account>/allocations/request', methods=['GET'])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reroute it to managedepartment instead

if not currentUser: # If the current user is not logged in
return render_template('errors/403.html')
if not currentUser.isLaborAdmin:
if not (currentUser.isLaborAdmin or currentUser.isLaborDepartmentStudent):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove currentuser.islabordepartmentstudent as they re only given to pendingforms and we figured out yesterday that islaboradmin can be given to student workers


# checking if the department has requested any allocation review
if not allocationExists(nextAY.termCode, dept, isFinal=False):
flash(f"The {dept.DEPT_NAME} department has not requested an allocation review yet.", "danger")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a warning or an info as this is nothing related to error it cannot be danger but this is about informing so this is likely a warning or info

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.

2 participants