mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 18:22:37 -04:00
Sometimes we manually check that a URL parameter is in a required set. Sometimes we don’t bother. This commit adds a URL converter to do this so that: - we don’t have to re-write the same code every time - it’s easier to apply this check to other endpoints This means endpoints that previously allowed a `template_type` or `message_type` of `None` now 404. So I’ve had to add new routes for with URLs that don’t include such parameters. So this…: ``` /services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications/sms.csv /services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications/None.csv ``` …becomes: ``` /services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications/sms.csv /services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications.csv ``` This matches what we do for the HTML-responding equivalent (see https://github.com/alphagov/notifications-admin/blob/265931d21746918c4ddfc19c4ad3f8cb5683c1bf/app/main/views/jobs.py#L215-L216)
9.5 KiB
9.5 KiB