Skip to content

Commit 6ca7630

Browse files
committed
fix tests
1 parent e19f98d commit 6ca7630

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

mailing/constants.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
default_mailing_schema = {
2-
"title": {
3-
"title": "Заголовок письма",
4-
"default": "Рассылка | Procollab",
5-
},
6-
"text": {"title": "Основной текст письма"},
7-
"button_text": {"title": "Текст кнопки", "default": "Кнопка"},
8-
}
1+
def get_default_mailing_schema() -> dict[str, dict[str, str]]:
2+
return {
3+
"title": {
4+
"title": "Заголовок письма",
5+
"default": "Рассылка | Procollab",
6+
},
7+
"text": {"title": "Основной текст письма"},
8+
"button_text": {"title": "Текст кнопки", "default": "Кнопка"},
9+
}

mailing/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import uuid
33

44
from django.db import models
5-
from .constants import default_mailing_schema
5+
from .constants import get_default_mailing_schema
66

77

88
def get_template_path(instance, filename):
@@ -13,7 +13,7 @@ def get_template_path(instance, filename):
1313

1414
class MailingSchema(models.Model):
1515
name = models.CharField(max_length=100, unique=True)
16-
schema = models.JSONField(default=default_mailing_schema, null=True, blank=True)
16+
schema = models.JSONField(default=get_default_mailing_schema, null=True, blank=True)
1717
template = models.TextField()
1818

1919
class Meta:

0 commit comments

Comments
 (0)