Skip to content

Commit 60ddd61

Browse files
committed
Tweaked Message.msgid and added needed migrations for the field. The first migration creates the new column with NULL values for existing rows, the second adds creation of msgid values by default for new rows.
- Legacy-Id: 12961
1 parent 119f486 commit 60ddd61

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.10.5 on 2017-03-03 13:04
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('message', '0002_messageattachment'),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name='message',
17+
name='msgid',
18+
field=models.CharField(blank=True, default=None, max_length=255, null=True),
19+
),
20+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.10.5 on 2017-03-03 13:10
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
import email.utils
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('message', '0003_message_msgid'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='message',
18+
name='msgid',
19+
field=models.CharField(blank=True, default=email.utils.make_msgid, max_length=255, null=True),
20+
),
21+
]

ietf/message/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Message(models.Model):
2121
reply_to = models.CharField(max_length=255, blank=True)
2222
body = models.TextField()
2323
content_type = models.CharField(default="text/plain", max_length=255, blank=True)
24-
msgid = models.CharField(max_length=255, blank=True, default=email.utils.make_msgid)
24+
msgid = models.CharField(max_length=255, blank=True, null=True, default=email.utils.make_msgid)
2525

2626
related_groups = models.ManyToManyField(Group, blank=True)
2727
related_docs = models.ManyToManyField(Document, blank=True)

0 commit comments

Comments
 (0)