forked from ubccr/coldfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Route mails to relevant approvers
dahyehayley edited this page Apr 7, 2025
·
3 revisions
https://github.com/NYU-RTS/rts-coldfront/pull/29 https://github.com/NYU-RTS/rts-coldfront/pull/30
- [tasks.py](http://tasks.py) (expiry allocation mails)
-
Refactored
send_expiry_emails
by separating the logic into two distinct functions:-
send_expiring_mails()
– handles notifications for allocations that are about to expire. -
send_expired_mails()
– handles notifications for allocations that have already expired.
-
- expiring soon:
- Changes to
send_expiring_mails
logic: -
Previous behavior: Iterated over all
AllocationUser
entries and sent emails based on user-specific roles in the allocation (e.g., if the user was linked to the project or allocation). -
Updated behavior: Now directly queries for allocations that are expiring (based on
EMAIL_ALLOCATION_EXPIRING_NOTIFICATION_DAYS
), and sends notifications to:-
Approvers whose
approver_profile.schools
include the allocation’s project school. - The PI (Principal Investigator) of the project.
-
Approvers whose
- Changes to
- expired:
-
Previous behavior: Iterated over all users and their associated
AllocationUser
entries to find expired allocations, sending notifications based on user involvement in the project. -
Updated behavior: Now directly queries for allocations that expired yesterday, and sends notifications to:
-
-
Approvers whose
approver_profile.schools
include the allocation’s project school.
-
Approvers whose
-
- The PI (Principal Investigator) of the project.
-
-
Previous behavior: Iterated over all users and their associated
-
Refactored
- [coldfront/core/utils/mail.py](https://github.com/NYU-RTS/rts-coldfront#diff-de2ac99e3e7af523acef8db66f625d319738cdf3781b00cb84916cfbec176bf6) (allocation creation mails)
- Updated send_allocation_admin_email to send allocation creation emails only to approvers whose associated schools include the allocation's project school.
- Improved flexibility of send_admin_email_template to take reciepint_list as optional