diff --git a/ietf/ietfauth/tests.py b/ietf/ietfauth/tests.py index 35c57a13a..d38972e16 100644 --- a/ietf/ietfauth/tests.py +++ b/ietf/ietfauth/tests.py @@ -155,7 +155,7 @@ class IetfAuthTests(TestCase): self.assertEqual(r.status_code, 200) self.assertIn("Add a whitelist entry", unicontent(r)) - r = self.client.post(urlreverse(ietf.ietfauth.views.add_account_whitelist), {"address": email}) + r = self.client.post(urlreverse(ietf.ietfauth.views.add_account_whitelist), {"email": email}) self.assertEqual(r.status_code, 200) self.assertIn("Whitelist entry creation successful", unicontent(r)) @@ -172,7 +172,7 @@ class IetfAuthTests(TestCase): saved_delay = settings.LIST_ACCOUNT_DELAY settings.LIST_ACCOUNT_DELAY = 1 email = "subscribed@example.com" - s = Subscribed(address=email) + s = Subscribed(email=email) s.save() time.sleep(1.1) self.register_and_verify(email) diff --git a/ietf/ietfauth/views.py b/ietf/ietfauth/views.py index 3d3cf2088..f3707b9bb 100644 --- a/ietf/ietfauth/views.py +++ b/ietf/ietfauth/views.py @@ -92,8 +92,8 @@ def create_account(request): form = RegistrationForm(request.POST) if form.is_valid(): to_email = form.cleaned_data['email'] # This will be lowercase if form.is_valid() - existing = Subscribed.objects.filter(address=to_email).first() - ok_to_create = ( Whitelisted.objects.filter(address=to_email).exists() + existing = Subscribed.objects.filter(email=to_email).first() + ok_to_create = ( Whitelisted.objects.filter(email=to_email).exists() or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() ) if ok_to_create: auth = django.core.signing.dumps(to_email, salt="create_account") @@ -377,8 +377,8 @@ def add_account_whitelist(request): if request.method == 'POST': form = WhitelistForm(request.POST) if form.is_valid(): - address = form.cleaned_data['address'] - entry = Whitelisted(address=address, by=request.user.person) + email = form.cleaned_data['email'] + entry = Whitelisted(email=email, by=request.user.person) entry.save() success = True else: diff --git a/ietf/mailinglists/admin.py b/ietf/mailinglists/admin.py index 01c85822d..aaa086823 100644 --- a/ietf/mailinglists/admin.py +++ b/ietf/mailinglists/admin.py @@ -12,12 +12,12 @@ admin.site.register(List, ListAdmin) class SubscribedAdmin(admin.ModelAdmin): - list_display = ('id', 'time', 'address') + list_display = ('id', 'time', 'email') raw_id_fields = ('lists',) - search_fields = ('address',) + search_fields = ('email',) admin.site.register(Subscribed, SubscribedAdmin) class WhitelistedAdmin(admin.ModelAdmin): - list_display = ('id', 'time', 'address', 'by') + list_display = ('id', 'time', 'email', 'by') admin.site.register(Whitelisted, WhitelistedAdmin) diff --git a/ietf/mailinglists/management/commands/import_mailman_listinfo.py b/ietf/mailinglists/management/commands/import_mailman_listinfo.py index 30a70aadf..4f9d15770 100644 --- a/ietf/mailinglists/management/commands/import_mailman_listinfo.py +++ b/ietf/mailinglists/management/commands/import_mailman_listinfo.py @@ -53,9 +53,9 @@ class Command(BaseCommand): list, created = List.objects.get_or_create(name=mlist.real_name, description=mlist.description, advertised=mlist.advertised) # The following calls return lowercased addresses members = mlist.getRegularMemberKeys() + mlist.getDigestMemberKeys() - known = [ s.address for s in Subscribed.objects.filter(lists__name=name) ] + known = [ s.email for s in Subscribed.objects.filter(lists__name=name) ] for addr in members: if not addr in known: self.note(" Adding subscribed: %s" % (addr)) - new, created = Subscribed.objects.get_or_create(address=addr) + new, created = Subscribed.objects.get_or_create(email=addr) new.lists.add(list) diff --git a/ietf/mailinglists/migrations/0002_list_subscribed_whitelisted.py b/ietf/mailinglists/migrations/0002_list_subscribed_whitelisted.py index f1d44890b..63bb3d939 100644 --- a/ietf/mailinglists/migrations/0002_list_subscribed_whitelisted.py +++ b/ietf/mailinglists/migrations/0002_list_subscribed_whitelisted.py @@ -8,7 +8,7 @@ import django.core.validators class Migration(migrations.Migration): dependencies = [ - ('person', '0014_auto_20160613_0751'), + ('person', '0013_add_plain_name_aliases'), ('mailinglists', '0001_initial'), ] @@ -30,7 +30,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('time', models.DateTimeField(auto_now_add=True)), - ('address', models.CharField(max_length=64, validators=[django.core.validators.EmailValidator()])), + ('email', models.CharField(max_length=64, validators=[django.core.validators.EmailValidator()])), ('lists', models.ManyToManyField(to='mailinglists.List')), ], options={ @@ -42,7 +42,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('time', models.DateTimeField(auto_now_add=True)), - ('address', models.CharField(max_length=64, validators=[django.core.validators.EmailValidator()])), + ('email', models.CharField(max_length=64, verbose_name=b'Email address', validators=[django.core.validators.EmailValidator()])), ('by', models.ForeignKey(to='person.Person')), ], options={ diff --git a/ietf/mailinglists/resources.py b/ietf/mailinglists/resources.py index b73995473..49f1786b5 100644 --- a/ietf/mailinglists/resources.py +++ b/ietf/mailinglists/resources.py @@ -22,7 +22,7 @@ class WhitelistedResource(ModelResource): filtering = { "id": ALL, "time": ALL, - "address": ALL, + "email": ALL, "by": ALL_WITH_RELATIONS, } api.mailinglists.register(WhitelistedResource()) @@ -51,7 +51,7 @@ class SubscribedResource(ModelResource): filtering = { "id": ALL, "time": ALL, - "address": ALL, + "email": ALL, "lists": ALL_WITH_RELATIONS, } api.mailinglists.register(SubscribedResource()) diff --git a/ietf/templates/ietfauth/whitelist_form.html b/ietf/templates/ietfauth/whitelist_form.html index 9bccd27c6..0a6a680ce 100644 --- a/ietf/templates/ietfauth/whitelist_form.html +++ b/ietf/templates/ietfauth/whitelist_form.html @@ -46,8 +46,8 @@ Google for the person's name within the ietf site: "Jane Doe site:ietf.org". If found, and the email address matches an address used in drafts or discussions, things are fine, and it's OK to add the address to the whitelist using this form, - and ask the person to please try the account creation form again. + and ask the person to please try the + account creation form again.
If the answer to this question shows clue, then add the address to the whitelist - using this form, and ask the person to please try the account creation form again. + using this form, and ask the person to please try the + account creation form again.