From ca235f12fd19f020aad9e9560d63fb5cc2fc8c0a Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Tue, 19 Aug 2025 12:43:58 -0700 Subject: [PATCH] providing creator of foldrs default permission --- app/main/views/templates.py | 5 ++++- app/notify_client/template_folder_api_client.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 6c48f8520..9d697361e 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -180,7 +180,10 @@ def process_folder_management_form(form, current_folder_id): if form.is_add_folder_op: new_folder_id = template_folder_api_client.create_template_folder( - current_service.id, name=form.get_folder_name(), parent_id=current_folder_id + current_service.id, + name=form.get_folder_name(), + parent_id=current_folder_id, + created_by_id=str(current_user.id) ) if form.is_move_op: diff --git a/app/notify_client/template_folder_api_client.py b/app/notify_client/template_folder_api_client.py index bdb10bea2..3257e5729 100644 --- a/app/notify_client/template_folder_api_client.py +++ b/app/notify_client/template_folder_api_client.py @@ -4,8 +4,10 @@ from app.notify_client import NotifyAdminAPIClient, cache class TemplateFolderAPIClient(NotifyAdminAPIClient): @cache.delete("service-{service_id}-template-folders") - def create_template_folder(self, service_id, name, parent_id=None): + def create_template_folder(self, service_id, name, parent_id=None, created_by_id=None): data = {"name": name, "parent_id": parent_id} + if created_by_id: + data["created_by_id"] = created_by_id return self.post("/service/{}/template-folder".format(service_id), data)[ "data" ]["id"]