diff --git a/app/main/views/templates.py b/app/main/views/templates.py index fd3eab99a..5e4410a68 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -438,10 +438,12 @@ def manage_template_folder(service_id, template_folder_id): name=current_folder['name'], users_with_permission=users_with_folder_permission ) - if form.validate_on_submit(): template_folder_api_client.update_template_folder( - current_service.id, template_folder_id, name=form.name.data + current_service.id, + template_folder_id, + name=form.name.data, + users_with_permission=form.viewing_permissions.data ) return redirect( url_for('.choose_template', service_id=service_id, template_folder_id=template_folder_id) diff --git a/app/notify_client/template_folder_api_client.py b/app/notify_client/template_folder_api_client.py index d273b4dc8..f7015c1cb 100644 --- a/app/notify_client/template_folder_api_client.py +++ b/app/notify_client/template_folder_api_client.py @@ -42,10 +42,13 @@ class TemplateFolderAPIClient(NotifyAdminAPIClient): )) @cache.delete('service-{service_id}-template-folders') - def update_template_folder(self, service_id, template_folder_id, name): + def update_template_folder(self, service_id, template_folder_id, name, users_with_permission=None): + data = {"name": name} + if users_with_permission: + data["users_with_permission"] = users_with_permission self.post( '/service/{}/template-folder/{}'.format(service_id, template_folder_id), - {"name": name} + data ) @cache.delete('service-{service_id}-template-folders') diff --git a/app/templates/components/checkbox.html b/app/templates/components/checkbox.html index 0a9e0907b..8adba1556 100644 --- a/app/templates/components/checkbox.html +++ b/app/templates/components/checkbox.html @@ -3,10 +3,11 @@ {% macro checkbox( field, hint=False, - width='2-3' + width='2-3', + value='y' ) %}
- {{ checkbox_input(field.id, field.name, field.data) }} + {{ checkbox_input(field.id, field.name, field.data, value) }}