mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
Standardise when we clear template cache
This is consistent with all other methods: we clear the cache after the actual change, not before it. Since the new version of -utils, we're now catching redis exceptions on delete, so this change has little effect on behaviour.
This commit is contained in:
@@ -216,8 +216,9 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
})
|
||||
data = _attach_current_user(data)
|
||||
endpoint = "/service/{0}/template/{1}".format(service_id, id_)
|
||||
ret = self.post(endpoint, data)
|
||||
self._delete_template_cache_for_service(service_id)
|
||||
return self.post(endpoint, data)
|
||||
return ret
|
||||
|
||||
@cache.delete('service-{service_id}-templates')
|
||||
def redact_service_template(self, service_id, id_):
|
||||
@@ -311,8 +312,9 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
'archived': True
|
||||
}
|
||||
data = _attach_current_user(data)
|
||||
ret = self.post(endpoint, data=data)
|
||||
self._delete_template_cache_for_service(service_id)
|
||||
return self.post(endpoint, data=data)
|
||||
return ret
|
||||
|
||||
# Temp access of service history data. Includes service and api key history
|
||||
def get_service_history(self, service_id):
|
||||
|
||||
Reference in New Issue
Block a user