mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Step 1 of renaming cache keys for templates
We want to change cache keys for templates and broadcasts to include
their service ID. So cache keys should change from
`template-{template_id}-versions` to
`service-{service_id}-template-{template_id}-versions`.
The first step of this which needs to be deployed as a change first is
to delete both keys when updating service templates (even if they key is
not yet set). This means that when we release code in the next PR to
start setting the new key, we won't run into a case where either the old
or the new key can remain set with stale data.
This commit is contained in:
@@ -32,6 +32,7 @@ class BroadcastMessageAPIClient(NotifyAdminAPIClient):
|
||||
return self.get(f'/service/{service_id}/broadcast-message/{broadcast_message_id}')
|
||||
|
||||
@cache.delete('broadcast-message-{broadcast_message_id}')
|
||||
@cache.delete('service-{service_id}-broadcast-message-{broadcast_message_id}')
|
||||
def update_broadcast_message(self, *, service_id, broadcast_message_id, data):
|
||||
self.post(
|
||||
f'/service/{service_id}/broadcast-message/{broadcast_message_id}',
|
||||
@@ -39,6 +40,7 @@ class BroadcastMessageAPIClient(NotifyAdminAPIClient):
|
||||
)
|
||||
|
||||
@cache.delete('broadcast-message-{broadcast_message_id}')
|
||||
@cache.delete('service-{service_id}-broadcast-message-{broadcast_message_id}')
|
||||
def update_broadcast_message_status(self, status, *, service_id, broadcast_message_id):
|
||||
data = _attach_current_user({
|
||||
'status': status,
|
||||
|
||||
Reference in New Issue
Block a user