File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 22import uuid
33
44from django .db import models
5- from .constants import default_mailing_schema
5+ from .constants import get_default_mailing_schema
66
77
88def get_template_path (instance , filename ):
@@ -13,7 +13,7 @@ def get_template_path(instance, filename):
1313
1414class 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 :
You can’t perform that action at this time.
0 commit comments