Skip to content

Commit e60a3e7

Browse files
committed
Increased the length of the list Subscribed email field from 64 to 128, updated the import_mailman_listinfo management command, and added a migration for the model change.
- Legacy-Id: 16370
1 parent 5e09c5a commit e60a3e7

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

ietf/mailinglists/management/commands/import_mailman_listinfo.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright The IETF Trust 2016, All Rights Reserved
1+
# Copyright The IETF Trust 2016-2019, All Rights Reserved
22

33
import sys
44
from textwrap import dedent
@@ -35,6 +35,8 @@ def note(msg):
3535

3636
names = list(Utils.list_names())
3737
names.sort()
38+
addr_max_length = Subscribed._meta.get_field('email').max_length
39+
debug.show('addr_max_length')
3840
for name in names:
3941
mlist = MailList.MailList(name, lock=False)
4042
note("List: %s" % mlist.internal_name())
@@ -62,7 +64,7 @@ def note(msg):
6264
note(" Removing address with no subscriptions: %s" % (addr))
6365
old.delete()
6466
for addr in members:
65-
if len(addr) > 64:
67+
if len(addr) > addr_max_length:
6668
sys.stderr.write(" ** Email address subscribed to '%s' too long for table: <%s>\n" % (name, addr))
6769
continue
6870
if not addr in known:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright The IETF Trust 2019, All Rights Reserved
3+
# Generated by Django 1.11.22 on 2019-07-03 13:44
4+
from __future__ import unicode_literals
5+
6+
import django.core.validators
7+
from django.db import migrations, models
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
dependencies = [
13+
('mailinglists', '0001_initial'),
14+
]
15+
16+
operations = [
17+
migrations.AlterField(
18+
model_name='subscribed',
19+
name='email',
20+
field=models.CharField(max_length=128, validators=[django.core.validators.EmailValidator()]),
21+
),
22+
]

ietf/mailinglists/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright The IETF Trust 2016, All Rights Reserved
1+
# Copyright The IETF Trust 2016-2019, All Rights Reserved
22

33

44
from django.conf import settings
@@ -19,7 +19,7 @@ def info_url(self):
1919

2020
class Subscribed(models.Model):
2121
time = models.DateTimeField(auto_now_add=True)
22-
email = models.CharField(max_length=64, validators=[validate_email])
22+
email = models.CharField(max_length=128, validators=[validate_email])
2323
lists = models.ManyToManyField(List)
2424
def __unicode__(self):
2525
return "<Subscribed: %s at %s>" % (self.email, self.time)

0 commit comments

Comments
 (0)