This commit is contained in:
j3d1 2024-05-22 19:56:23 +02:00
parent 08c1ec1619
commit 5427e8dc7a
2 changed files with 7 additions and 3 deletions

View file

@ -16,9 +16,11 @@ class Migration(migrations.Migration):
] ]
def create_required_templates(apps, schema_editor): def create_required_templates(apps, schema_editor):
MessageTemplate.objects.create(name='auto_reply', message=auto_reply_body) MessageTemplate.objects.create(name='auto_reply', message=auto_reply_body, marked_required=True)
MessageTemplate.objects.create(name='new_issue_notification', message=new_issue_notification) MessageTemplate.objects.create(name='new_issue_notification', message=new_issue_notification,
MessageTemplate.objects.create(name='reply_issue_notification', message=reply_issue_notification) marked_required=True)
MessageTemplate.objects.create(name='reply_issue_notification', message=reply_issue_notification,
marked_required=True)
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
@ -29,6 +31,7 @@ class Migration(migrations.Migration):
('message', models.TextField()), ('message', models.TextField()),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('marked_confidential', models.BooleanField(default=False)), ('marked_confidential', models.BooleanField(default=False)),
('marked_required', models.BooleanField(default=False)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(

View file

@ -8,6 +8,7 @@ class MessageTemplate(models.Model):
message = models.TextField() message = models.TextField()
created = models.DateTimeField(auto_now_add=True) created = models.DateTimeField(auto_now_add=True)
marked_confidential = models.BooleanField(default=False) marked_confidential = models.BooleanField(default=False)
marked_required = models.BooleanField(default=False) # may not be deleted
def __str__(self): def __str__(self):
return self.name return self.name