Repository navigation
Sponsor Management UI - #2972
JacobCoffee wants to merge 84 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a staff-facing Sponsor Management UI under the sponsors app, plus supporting infrastructure for email testing and outbound-notification auditing/logging.
Changes:
- Add a new
/sponsors/manage/management UI (templates, forms, URLs) for handling sponsorships, packages, benefits, contacts, contracts, and notifications. - Persist outbound sponsorship notification sends to a new
SponsorshipNotificationLogmodel and display history in the management UI. - Improve local dev ergonomics by adding MailDev + SMTP-backed local email configuration; update sponsor contract email templates; bump
django-storages.
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Bumps django-storages from 1.14.4 to 1.14.6 (lockfile update). |
pydotorg/settings/local.py |
Uses SMTP backend when EMAIL_HOST is set (for MailDev), otherwise console backend. |
docker-compose.yml |
Adds a maildev service and wires EMAIL_HOST/EMAIL_PORT into the web service. |
apps/sponsors/use_cases.py |
Logs each sent sponsorship notification to SponsorshipNotificationLog. |
apps/sponsors/urls.py |
Mounts the management UI under sponsors/manage/. |
apps/sponsors/templates/sponsors/manage/sponsorship_notify.html |
UI to preview/send a notification for a single sponsorship. |
apps/sponsors/templates/sponsors/manage/sponsorship_list.html |
Sponsorship list UI with filters, bulk actions, and live search. |
apps/sponsors/templates/sponsors/manage/sponsorship_edit.html |
Edit sponsorship details (package/fee/year). |
apps/sponsors/templates/sponsors/manage/sponsorship_detail.html |
Sponsorship detail/review UI incl. contracts, benefits, assets, communications. |
apps/sponsors/templates/sponsors/manage/sponsorship_approve_signed.html |
Approve sponsorship while uploading a signed contract document. |
apps/sponsors/templates/sponsors/manage/sponsorship_approve.html |
Approve sponsorship (creates draft contract) with quick date helpers. |
apps/sponsors/templates/sponsors/manage/sponsor_edit.html |
Create/edit sponsor company data. |
apps/sponsors/templates/sponsors/manage/package_list.html |
Package list UI grouped by year. |
apps/sponsors/templates/sponsors/manage/package_form.html |
Create/edit a sponsorship package. |
apps/sponsors/templates/sponsors/manage/package_confirm_delete.html |
Confirm-delete UI for packages. |
apps/sponsors/templates/sponsors/manage/notification_template_list.html |
List notification templates in the management UI. |
apps/sponsors/templates/sponsors/manage/notification_template_form.html |
Create/edit notification templates with variable copy helpers. |
apps/sponsors/templates/sponsors/manage/notification_template_confirm_delete.html |
Confirm-delete UI for notification templates. |
apps/sponsors/templates/sponsors/manage/notification_history.html |
Management UI listing sent notifications (log history). |
apps/sponsors/templates/sponsors/manage/guide.html |
End-user guide for PSF sponsorship team workflows. |
apps/sponsors/templates/sponsors/manage/dashboard.html |
Management dashboard summary for a selected year. |
apps/sponsors/templates/sponsors/manage/current_year_form.html |
UI to set the active sponsorship year. |
apps/sponsors/templates/sponsors/manage/contract_send.html |
UI for generating/sending contracts and internal review. |
apps/sponsors/templates/sponsors/manage/contract_execute.html |
UI to upload signed contract and execute/finalize sponsorship. |
apps/sponsors/templates/sponsors/manage/contact_form.html |
Create/edit sponsor contact roles and info. |
apps/sponsors/templates/sponsors/manage/clone_year.html |
Clone packages/benefits from one year to another. |
apps/sponsors/templates/sponsors/manage/bulk_notify.html |
UI to send notifications in bulk across sponsorships. |
apps/sponsors/templates/sponsors/manage/benefit_list.html |
Benefit list UI with filtering/pagination. |
apps/sponsors/templates/sponsors/manage/benefit_form.html |
Create/edit benefit + manage feature configurations and related data. |
apps/sponsors/templates/sponsors/manage/benefit_confirm_delete.html |
Confirm-delete UI for benefits. |
apps/sponsors/templates/sponsors/manage/benefit_config_form.html |
Create/edit benefit feature configuration objects. |
apps/sponsors/templates/sponsors/manage/_base.html |
Management UI shell + global JS table-sorting helper. |
apps/sponsors/templates/sponsors/email/sponsor_contract_subject.txt |
Replaces placeholder subject with a real contract subject template. |
apps/sponsors/templates/sponsors/email/sponsor_contract.txt |
Replaces placeholder contract email body with real copy. |
apps/sponsors/models/notifications.py |
Adds SponsorshipNotificationLog model to persist sent notifications. |
apps/sponsors/models/__init__.py |
Re-exports SponsorshipNotificationLog. |
apps/sponsors/migrations/0104_add_notification_log.py |
Migration creating the notification log table. |
apps/sponsors/management/commands/seed_sponsor_manage_data.py |
Dev-only command to seed realistic data for the management UI. |
apps/sponsors/manage/urls.py |
URL routing for the management UI. |
apps/sponsors/manage/forms.py |
Forms backing the management UI (benefits/packages/sponsorship ops/notifications/etc.). |
apps/sponsors/manage/__init__.py |
Documents that the manage UI is staff/group restricted. |
💡 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 43 out of 44 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 43 out of 43 changed files in this pull request and generated 1 comment.
💡 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 43 out of 43 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 49 out of 51 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
may be best to split on 6c06c38 (before all the ai fun bits), merge that, and pull anything after into other PRs |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 49 out of 51 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🔵 Needs a closer look
The notification history template currently renders an incorrect count badge due to applying |length to paginator.count (an integer).
Review details
Suppressed comments (1)
apps/sponsors/templates/sponsors/manage/notification_history.html:24
paginator.countis an integer, so piping it through|lengthalways yields 0 (TypeError -> 0). This makes the “Sent Notifications” badge incorrect whenever pagination is enabled. Use the count directly (orlogs|lengthonly when there is no paginator).
- Files reviewed: 49/51 changed files
- Comments generated: 0 new
- Review effort level: Lite
d5ee775 to
17e7e30
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several workflows can report false delivery success or produce incomplete and inconsistent management data.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (10)
Delete stale contract files when clearing FileFields · New Apply asset filters before limiting results · New Use selected contact types in bulk previews · New Prevent benefit-only cloning from creating orphaned packages · New Prefetch benefit packages to avoid dashboard N+1 queries · New Avoid N+1 queries when counting package benefits · New Render zero sponsorship fees as $0, not an em dash · New Use selected contact types when building notification previews · New Report success only after confirmed email delivery · New Clarify approval alert's create-or-reuse contract behavior · New
…asset cap, N+1s, redraft file cleanup



No description provided.