diff --git a/ietf/mailinglists/management/commands/import_mailman_listinfo.py b/ietf/mailinglists/management/commands/import_mailman_listinfo.py index fdb10c083..146e8b850 100644 --- a/ietf/mailinglists/management/commands/import_mailman_listinfo.py +++ b/ietf/mailinglists/management/commands/import_mailman_listinfo.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2016, All Rights Reserved +# Copyright The IETF Trust 2016-2019, All Rights Reserved import sys from textwrap import dedent @@ -35,6 +35,8 @@ def import_mailman_listinfo(verbosity=0): names = list(Utils.list_names()) names.sort() + addr_max_length = Subscribed._meta.get_field('email').max_length + debug.show('addr_max_length') for name in names: mlist = MailList.MailList(name, lock=False) note("List: %s" % mlist.internal_name()) @@ -62,7 +64,7 @@ def import_mailman_listinfo(verbosity=0): note(" Removing address with no subscriptions: %s" % (addr)) old.delete() for addr in members: - if len(addr) > 64: + if len(addr) > addr_max_length: sys.stderr.write(" ** Email address subscribed to '%s' too long for table: <%s>\n" % (name, addr)) continue if not addr in known: diff --git a/ietf/mailinglists/migrations/0002_auto_20190703_1344.py b/ietf/mailinglists/migrations/0002_auto_20190703_1344.py new file mode 100644 index 000000000..a99b72323 --- /dev/null +++ b/ietf/mailinglists/migrations/0002_auto_20190703_1344.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright The IETF Trust 2019, All Rights Reserved +# Generated by Django 1.11.22 on 2019-07-03 13:44 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mailinglists', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='subscribed', + name='email', + field=models.CharField(max_length=128, validators=[django.core.validators.EmailValidator()]), + ), + ] diff --git a/ietf/mailinglists/models.py b/ietf/mailinglists/models.py index 119afac74..f515eff2c 100644 --- a/ietf/mailinglists/models.py +++ b/ietf/mailinglists/models.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2016, All Rights Reserved +# Copyright The IETF Trust 2016-2019, All Rights Reserved from django.conf import settings @@ -19,7 +19,7 @@ class List(models.Model): class Subscribed(models.Model): time = models.DateTimeField(auto_now_add=True) - email = models.CharField(max_length=64, validators=[validate_email]) + email = models.CharField(max_length=128, validators=[validate_email]) lists = models.ManyToManyField(List) def __unicode__(self): return "" % (self.email, self.time)