mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Clear user cache when broadcast service settings form is submitted
When the broadcast service settings form is submitted it now removes all permissions for users in notifications-api. This means it should be clearing the user cache.
This commit is contained in:
@@ -618,13 +618,16 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
|
||||
@cache.delete('service-{service_id}')
|
||||
def set_service_broadcast_settings(
|
||||
self, service_id, service_mode, broadcast_channel, provider_restriction
|
||||
self, service_id, service_mode, broadcast_channel, provider_restriction, cached_service_user_ids
|
||||
):
|
||||
"""
|
||||
service_mode is one of "training" or "live"
|
||||
broadcast channel is one of "test" or "severe"
|
||||
broadcast channel is one of "operator", "test", "severe", "government"
|
||||
provider_restriction is one of "all", "three", "o2", "vodafone", "ee"
|
||||
"""
|
||||
if cached_service_user_ids:
|
||||
redis_client.delete(*map('user-{}'.format, cached_service_user_ids))
|
||||
|
||||
data = {
|
||||
"service_mode": service_mode,
|
||||
"broadcast_channel": broadcast_channel,
|
||||
|
||||
Reference in New Issue
Block a user