From 84d124699b8656487c8eef8fd9f2931806099a56 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Fri, 22 May 2026 18:00:40 +0800 Subject: [PATCH] fix: preserve template placeholders when editing message templates --- apps/notifications/api/notifications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/notifications/api/notifications.py b/apps/notifications/api/notifications.py index 335e7a0e0..150486cde 100644 --- a/apps/notifications/api/notifications.py +++ b/apps/notifications/api/notifications.py @@ -186,7 +186,7 @@ class TemplateViewSet(JMSGenericViewSet): serializer.is_valid(raise_exception=True) template_name = serializer.validated_data['template_name'] content = serializer.validated_data['template_content'] - render_html = serializer.validated_data['render_html'] + __ = serializer.validated_data['render_html'] data_path = _get_data_template_path(template_name) edit_path = _get_edit_template_path(template_name) @@ -194,7 +194,7 @@ class TemplateViewSet(JMSGenericViewSet): try: os.makedirs(data_dir, exist_ok=True) with open(data_path, 'w', encoding='utf-8') as f: - f.write(render_html) + f.write(content) with open(edit_path, 'w', encoding='utf-8') as f: f.write(content) except Exception as e: