Skip to content

Add department-level monthly storage report email with PDF attachment#478

Merged
claire-peters merged 4 commits into
masterfrom
cp_dept_storagereport
Jun 17, 2026
Merged

Add department-level monthly storage report email with PDF attachment#478
claire-peters merged 4 commits into
masterfrom
cp_dept_storagereport

Conversation

@claire-peters

@claire-peters claire-peters commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add dept_storage_report.txt email template with department name, ticket address, and signature variables
  • Add DepartmentStorageReportView (PDFView) in department/views.py gated to superusers and department approvers, rendering a usage summary card and monthly storage invoice details table (matching the DepartmentDetail page, without pagination)
  • Add <int:pk>/report URL route (department-report) in department/urls.py
  • Add send_dept_storage_report_emails() and send_dept_storagereport_pdf() to project/tasks.py — sends to departments with rank school or institution, addressed to members with the Approver role

Test plan

  • Navigate to /department/<pk>/report as a superuser and confirm PDF renders with usage summary and invoice details table
  • Navigate to /department/<pk>/report as a department Approver and confirm access is granted
  • Navigate to /department/<pk>/report as a non-member and confirm 403
  • Confirm usage summary counts (labs, allocations, users) only reflect labs with active storage allocations
  • Call send_dept_storage_report_emails() in the Django shell and confirm emails are sent only for departments with rank school or institution
  • Confirm departments with other ranks are skipped
  • Confirm PDF attachment is named <DeptCode>_<Month>_<Year>_dept_storagereport.pdf

@claire-peters claire-peters merged commit c3d7fc4 into master Jun 17, 2026
2 checks passed
@claire-peters claire-peters deleted the cp_dept_storagereport branch June 17, 2026 22:27
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.

1 participant