Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/admin_api/serializers/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ class _NotiTemplateAdminSerializerBase(BaseAbstractSerializer, JsonSchemaSeriali
template_variables = serializers.SerializerMethodField()

class Meta:
fields = COMMON_ADMIN_FIELDS + ("code", "title", "description", "data", "sent_from", "template_variables")
fields = COMMON_ADMIN_FIELDS + (
"code",
"title",
"description",
"data",
"editor_source",
"sent_from",
"template_variables",
)

def get_template_variables(self, obj: NotificationTemplateBase) -> list[str]:
return sorted(obj.template_variables)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [("notification", "0002_emailnotificationhistorysentto_failure_reason_and_more")]
operations = [
migrations.AddField(
model_name="emailnotificationtemplate",
name="editor_source",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="nhncloudkakaoalimtalknotificationtemplate",
name="editor_source",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="nhncloudsmsnotificationtemplate",
name="editor_source",
field=models.TextField(blank=True, null=True),
),
]
4 changes: 4 additions & 0 deletions app/notification/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class NotificationTemplateBase(BaseAbstractModel):
description = models.TextField(null=True, blank=True)
data = models.TextField()

# 에디터(예: @react-email/renderer)가 다루는 source-of-truth.
# 발송 경로는 data만 사용하며, 에디터가 저장 시점에 컴파일된 결과를 data에 기록.
editor_source = models.TextField(null=True, blank=True)

# Email: from address, SMS: 발신번호, Kakao: sender key
sent_from = models.CharField(max_length=256)

Expand Down
3 changes: 2 additions & 1 deletion envfile/.env.local
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
DJANGO_DEFAULT_STORAGE_BACKEND=django.core.files.storage.FileSystemStorage
DJANGO_STATIC_STORAGE_BACKEND=django.contrib.staticfiles.storage.StaticFilesStorage
DATABASE_ENGINE=django.db.backends.postgresql
DATABASE_NAME=pyconkr-backend-db
DATABASE_NAME=pyconkr_2025_test_db
LEGACY_DATABASE_NAME=pyconkr_purchase_test_db
DATABASE_HOST=127.0.0.1
DATABASE_PORT=45432
DATABASE_USER=user
Expand Down
Loading