mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Rewrite cache decorator to use format string
This is easier to read than having to understand the arguments 1…n of
the cache decorator are ‘magic’, and gives us more flexibility about
how the cache keys are formatted, eg being able to add words in the
middle of them.
Also changes the key format for all templates to be
`service-{service_id}-templates` instead of `templates-{service_id}`
because then it’s clearer what the ID represents.
This commit is contained in:
@@ -27,7 +27,7 @@ class OrganisationsClient(NotifyAdminAPIClient):
|
||||
def get_service_organisation(self, service_id):
|
||||
return self.get(url="/service/{}/organisation".format(service_id))
|
||||
|
||||
@cache.delete('service', 'service_id')
|
||||
@cache.delete('service-{service_id}')
|
||||
def update_service_organisation(self, service_id, org_id):
|
||||
data = {
|
||||
'service_id': service_id
|
||||
|
||||
Reference in New Issue
Block a user