mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Add a selectField to edit and create templates that is only visible for platform admins that makes the template a priority template.
There is a check that the template can not be created as priority if the user is not a platform admin. There is a check that the template can not change the `priority` unless they are a platform admin.
This commit is contained in:
@@ -116,7 +116,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
data = _attach_current_user({})
|
||||
return self.delete(endpoint, data)
|
||||
|
||||
def create_service_template(self, name, type_, content, service_id, subject=None):
|
||||
def create_service_template(self, name, type_, content, service_id, subject=None, process_type='normal'):
|
||||
"""
|
||||
Create a service template.
|
||||
"""
|
||||
@@ -124,7 +124,8 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
"name": name,
|
||||
"template_type": type_,
|
||||
"content": content,
|
||||
"service": service_id
|
||||
"service": service_id,
|
||||
"process_type": process_type
|
||||
}
|
||||
if subject:
|
||||
data.update({
|
||||
@@ -132,9 +133,10 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
})
|
||||
data = _attach_current_user(data)
|
||||
endpoint = "/service/{0}/template".format(service_id)
|
||||
print('got here in create_service_template')
|
||||
return self.post(endpoint, data)
|
||||
|
||||
def update_service_template(self, id_, name, type_, content, service_id, subject=None):
|
||||
def update_service_template(self, id_, name, type_, content, service_id, subject=None, process_type=None):
|
||||
"""
|
||||
Update a service template.
|
||||
"""
|
||||
@@ -149,6 +151,10 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
data.update({
|
||||
'subject': subject
|
||||
})
|
||||
if process_type:
|
||||
data.update({
|
||||
'process_type': process_type
|
||||
})
|
||||
data = _attach_current_user(data)
|
||||
endpoint = "/service/{0}/template/{1}".format(service_id, id_)
|
||||
return self.post(endpoint, data)
|
||||
|
||||
Reference in New Issue
Block a user