Change postage while editing template

This commit is contained in:
Pea Tyczynska
2018-12-18 18:22:03 +00:00
parent a60d269900
commit 687e9e5866
4 changed files with 37 additions and 5 deletions

View File

@@ -153,7 +153,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
@cache.delete('service-{service_id}-templates')
@cache.delete('template-{id_}-version-None')
@cache.delete('template-{id_}-versions')
def update_service_template(self, id_, name, type_, content, service_id, subject=None, process_type=None):
def update_service_template(self, id_, name, type_, content, service_id, subject=None, process_type=None, postage=None):
"""
Update a service template.
"""
@@ -172,6 +172,10 @@ class ServiceAPIClient(NotifyAdminAPIClient):
data.update({
'process_type': process_type
})
if postage:
data.update({
'postage': postage
})
data = _attach_current_user(data)
endpoint = "/service/{0}/template/{1}".format(service_id, id_)
return self.post(endpoint, data)