mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Remove update_organisation_name model method
It’s weird to have a method just for updating one attribute. I think
the reason for doing this was to only invalidate the
`organisation-{}-name` cache when absolutely necessary, but:
- we don’t need a separate method to check whether it’s the name being
updated
- it was easy to get around this by calling
`OrganisationsClient.update_organisation` directly, leaving a stale
value in the cache
This commit is contained in:
@@ -56,11 +56,10 @@ class OrganisationsClient(NotifyAdminAPIClient):
|
||||
if cached_service_ids:
|
||||
redis_client.delete(*map('service-{}'.format, cached_service_ids))
|
||||
|
||||
return api_response
|
||||
if 'name' in kwargs:
|
||||
redis_client.delete(f'organisation-{org_id}-name')
|
||||
|
||||
@cache.delete('organisation-{org_id}-name')
|
||||
def update_organisation_name(self, org_id, name):
|
||||
return self.update_organisation(org_id, name=name)
|
||||
return api_response
|
||||
|
||||
@cache.delete('service-{service_id}')
|
||||
@cache.delete('live-service-and-organisation-counts')
|
||||
|
||||
Reference in New Issue
Block a user