mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
Stop Redis exception by not passing Redis an empty set to delete
We use `redis_client.delete` to delete multiple keys at once, but this raises a `redis.exceptions.ResponseError` if it is called with an empty list or set. We should only call `redis_client.delete` when there is at least one item to delete.
This commit is contained in:
@@ -38,10 +38,11 @@ class TemplateFolderAPIClient(NotifyAdminAPIClient):
|
||||
'folders': list(folder_ids),
|
||||
})
|
||||
|
||||
self.redis_client.delete(*map(
|
||||
'template-{}-version-None'.format,
|
||||
template_ids,
|
||||
))
|
||||
if template_ids:
|
||||
self.redis_client.delete(*map(
|
||||
'template-{}-version-None'.format,
|
||||
template_ids,
|
||||
))
|
||||
|
||||
@cache.delete('service-{service_id}-template-folders')
|
||||
def update_template_folder(self, service_id, template_folder_id, name):
|
||||
|
||||
Reference in New Issue
Block a user