AM-1084 city pass: scheduled notification - #231
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the City Pass (and modules) notification flow to support scheduling notifications via send_at, including admin UX changes and service-side creation/deletion of scheduled notifications, alongside routine dependency bumps.
Changes:
- Updated notification services/admin flows to upsert scheduled notifications using a deterministic identifier and to delete scheduled notifications when
send_atis cleared/canceled. - Updated admin confirmation templates to reflect scheduling and show a “modification deadline”.
- Refreshed dependency lockfiles (
uv.lock,requirements.txt) and updated/extended unit + integration tests around scheduled notifications.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Bumps multiple pinned dependency versions in the uv lockfile. |
requirements.txt |
Updates exported/pinned requirements to match new lock state. |
modules/admin/notification_admin.py |
Ensures scheduled notifications are deleted when scheduling is canceled/removed (modules app). |
core/templates/admin/notification_confirm_send.html |
Adjusts admin confirmation copy/UI for “scheduled” notifications and shows a deadline. |
city_pass/tests/services/test_notification.py |
Updates/extends service tests to use send_at scheduling and verify scheduled time is preserved. |
city_pass/services/notification.py |
Switches to scheduling-only upsert when send_at is set; adds deterministic identifier + delete helper. |
city_pass/integration_tests/test_notifications.py |
Updates integration tests to cover scheduled notification behavior. |
city_pass/admin/notification_admin.py |
Adds scheduling-aware admin behavior (confirm flow, lock window, delete behavior, deadline display). |
Suppressed comments (2)
city_pass/admin/notification_admin.py:60
has_delete_permissionreturnsTruefor any unlocked object, bypassing Django’s built-in delete permission checks (e.g.city_pass.delete_notification). Delegate tosuper()and only add the lock constraint.
def has_delete_permission(self, request, obj=None):
if obj and self._notification_is_locked(obj):
return False
return True
city_pass/admin/notification_admin.py:163
- The “Verstuurd?” flag currently becomes
Truefor any scheduled notification with a futuresend_at(becausesend_atis set andnr_sessionsis populated). This will incorrectly mark future scheduled notifications as already sent in the admin list.
@admin.display(boolean=True, description="Verstuurd?")
def send(self, obj) -> bool:
return obj.send_at is not None and obj.nr_sessions > 0
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
RikSchefferAmsterdam
previously approved these changes
Aug 17, 2026
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.
Changes
This PR updates the City Pass (and modules) notification flow to support scheduling notifications via
send_at, including admin UX changes and service-side creation/deletion of scheduled notifications, alongside routine dependency bumps.Changes:
send_atis cleared/canceled.uv.lock,requirements.txt) and updated/extended unit + integration tests around scheduled notifications.Affected services
Definition of done
make openapi-diff)make dev)make requirements)- [ ] Infrastructure config updated (aapp_azure_infra)- [ ] Loadtests for relevant endpoints (aapp_testing_loadtests)After PR created (and deployed on dev):
^ stadspas is niet beschikbaar op ontwikkel omgeving
Other notes
GitHub Copilot was used in writing the code