Events: notify guests on cancellation and keep cancelled pages visible - #294
Merged
Merged
Conversation
Cancel now reaches the guests, not just the database. cancel_event is idempotent, skips the event's pending reminders, and after commit dispatches an events.notify_cancellation job that mails one events.event_cancelled delivery per active registration, deduped by registration and ics_sequence. The mail context resolves the absolute event URL and a calendar_cancel_url; for a cancelled event calendar.ics serves a METHOD:CANCEL invite so the guest can remove the calendar entry (the package mail pipeline carries no attachments, so the cancel invite is a one-click link rather than an inline attachment). A cancelled event keeps its detail page with a Cancelled badge and schema.org EventCancelled status instead of 404ing, while staying out of public listings; registration remains closed. The reminder send handler skips reminders whose event is no longer upcoming. Relay-side, the events.event_cancelled template is an operator step in the transactional catalog, as for the other events purposes.
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.
Goal
Make event cancellation a package feature: guests are notified when an event is cancelled, the invite can be removed from their calendar, and the event page says "Cancelled" instead of 404ing. Requested by the product owner after cancelling a live event on the AISL site (which ships its own copy in the old-generation app); this brings the capability to every site via
community_base.events.What changed
cancel_eventis idempotent (re-cancelling no longer re-bumpsics_sequenceor re-notifies), skips the event's pending reminders, and after commit dispatches anevents.notify_cancellationjob.events.event_cancelleddelivery per active registration (pending_verification/confirmed), deduped byevents.cancellation:{registration}:{ics_sequence}. Inactive registrations are never mailed; series subscribers are covered because they are enrolled as regular registrations at publish time.mail_contextresolves the absoluteevent_urlandcalendar_cancel_urlfor the new purpose (requiresSITE_URL, per the C7.27 rule).calendar.icsserves aMETHOD:CANCEL/STATUS:CANCELLEDinvite for cancelled events, so the email's one-click link removes the calendar entry. The package mail pipeline carries no attachments; the cancel invite is link-based, not inline.schema.orgEventCancelledJSON-LD) instead of 404ing, while staying out of public listings; registration stays closed (_require_availablealready rejects non-upcoming events).event_inactive).events.event_cancelledtemplate is an operator step in the transactional catalog, as for the other events purposes.Verification
uv run ruff check .— clean;uv run ruff format --check .— 846 files formatted.uv run python testproject/manage.py check— no issues;makemigrations --check --dry-run— no changes detected (no model change).uv sync --all-extras;uv run pytest tests/— 2211 passed (events: 118, incl. 9 new tests).uv run pytest tests/test_boundaries.py— passed.events/tests,core/tests(kernel, repository contracts, homepage),event_registrants,review_import/tests/test_workflow.py— 137 passed + 228 subtests.Notes for adoption
v0.5.6(version bumped here).events.event_cancelledtemplate in its Relay transactional catalog (context:event_url,calendar_cancel_url,event_title,event_start,event_timezone,manage-style registration context) before cancellation mails deliver; until then deliveries fail loudly and retry, per the SITE_URL/purpose rule.