Skip to content

Commit 016f912

Browse files
committed
Changed some field names from address to email.
- Legacy-Id: 11385
1 parent c0ba793 commit 016f912

9 files changed

Lines changed: 20 additions & 20 deletions

File tree

ietf/ietfauth/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def test_create_whitelisted_account(self):
155155
self.assertEqual(r.status_code, 200)
156156
self.assertIn("Add a whitelist entry", unicontent(r))
157157

158-
r = self.client.post(urlreverse(ietf.ietfauth.views.add_account_whitelist), {"address": email})
158+
r = self.client.post(urlreverse(ietf.ietfauth.views.add_account_whitelist), {"email": email})
159159
self.assertEqual(r.status_code, 200)
160160
self.assertIn("Whitelist entry creation successful", unicontent(r))
161161

@@ -172,7 +172,7 @@ def test_create_subscribed_account(self):
172172
saved_delay = settings.LIST_ACCOUNT_DELAY
173173
settings.LIST_ACCOUNT_DELAY = 1
174174
email = "subscribed@example.com"
175-
s = Subscribed(address=email)
175+
s = Subscribed(email=email)
176176
s.save()
177177
time.sleep(1.1)
178178
self.register_and_verify(email)

ietf/ietfauth/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def create_account(request):
9292
form = RegistrationForm(request.POST)
9393
if form.is_valid():
9494
to_email = form.cleaned_data['email'] # This will be lowercase if form.is_valid()
95-
existing = Subscribed.objects.filter(address=to_email).first()
96-
ok_to_create = ( Whitelisted.objects.filter(address=to_email).exists()
95+
existing = Subscribed.objects.filter(email=to_email).first()
96+
ok_to_create = ( Whitelisted.objects.filter(email=to_email).exists()
9797
or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() )
9898
if ok_to_create:
9999
auth = django.core.signing.dumps(to_email, salt="create_account")
@@ -377,8 +377,8 @@ def add_account_whitelist(request):
377377
if request.method == 'POST':
378378
form = WhitelistForm(request.POST)
379379
if form.is_valid():
380-
address = form.cleaned_data['address']
381-
entry = Whitelisted(address=address, by=request.user.person)
380+
email = form.cleaned_data['email']
381+
entry = Whitelisted(email=email, by=request.user.person)
382382
entry.save()
383383
success = True
384384
else:

ietf/mailinglists/admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ class ListAdmin(admin.ModelAdmin):
1212

1313

1414
class SubscribedAdmin(admin.ModelAdmin):
15-
list_display = ('id', 'time', 'address')
15+
list_display = ('id', 'time', 'email')
1616
raw_id_fields = ('lists',)
17-
search_fields = ('address',)
17+
search_fields = ('email',)
1818
admin.site.register(Subscribed, SubscribedAdmin)
1919

2020

2121
class WhitelistedAdmin(admin.ModelAdmin):
22-
list_display = ('id', 'time', 'address', 'by')
22+
list_display = ('id', 'time', 'email', 'by')
2323
admin.site.register(Whitelisted, WhitelistedAdmin)

ietf/mailinglists/management/commands/import_mailman_listinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ def handle(self, *filenames, **options):
5353
list, created = List.objects.get_or_create(name=mlist.real_name, description=mlist.description, advertised=mlist.advertised)
5454
# The following calls return lowercased addresses
5555
members = mlist.getRegularMemberKeys() + mlist.getDigestMemberKeys()
56-
known = [ s.address for s in Subscribed.objects.filter(lists__name=name) ]
56+
known = [ s.email for s in Subscribed.objects.filter(lists__name=name) ]
5757
for addr in members:
5858
if not addr in known:
5959
self.note(" Adding subscribed: %s" % (addr))
60-
new, created = Subscribed.objects.get_or_create(address=addr)
60+
new, created = Subscribed.objects.get_or_create(email=addr)
6161
new.lists.add(list)

ietf/mailinglists/migrations/0002_list_subscribed_whitelisted.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Migration(migrations.Migration):
99

1010
dependencies = [
11-
('person', '0014_auto_20160613_0751'),
11+
('person', '0013_add_plain_name_aliases'),
1212
('mailinglists', '0001_initial'),
1313
]
1414

@@ -30,7 +30,7 @@ class Migration(migrations.Migration):
3030
fields=[
3131
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
3232
('time', models.DateTimeField(auto_now_add=True)),
33-
('address', models.CharField(max_length=64, validators=[django.core.validators.EmailValidator()])),
33+
('email', models.CharField(max_length=64, validators=[django.core.validators.EmailValidator()])),
3434
('lists', models.ManyToManyField(to='mailinglists.List')),
3535
],
3636
options={
@@ -42,7 +42,7 @@ class Migration(migrations.Migration):
4242
fields=[
4343
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
4444
('time', models.DateTimeField(auto_now_add=True)),
45-
('address', models.CharField(max_length=64, validators=[django.core.validators.EmailValidator()])),
45+
('email', models.CharField(max_length=64, verbose_name=b'Email address', validators=[django.core.validators.EmailValidator()])),
4646
('by', models.ForeignKey(to='person.Person')),
4747
],
4848
options={

ietf/mailinglists/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Meta:
2222
filtering = {
2323
"id": ALL,
2424
"time": ALL,
25-
"address": ALL,
25+
"email": ALL,
2626
"by": ALL_WITH_RELATIONS,
2727
}
2828
api.mailinglists.register(WhitelistedResource())
@@ -51,7 +51,7 @@ class Meta:
5151
filtering = {
5252
"id": ALL,
5353
"time": ALL,
54-
"address": ALL,
54+
"email": ALL,
5555
"lists": ALL_WITH_RELATIONS,
5656
}
5757
api.mailinglists.register(SubscribedResource())

ietf/templates/ietfauth/whitelist_form.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ <h1>Add a whitelist entry for account creation.</h1>
4646
Google for the person's name within the ietf site: "Jane Doe site:ietf.org". If
4747
found, and the email address matches an address used in drafts or discussions,
4848
things are fine, and it's OK to add the address to the whitelist using this form,
49-
and ask the person to please try the <a href="{% url
50-
'ietf.ietfauth.views.create_account' %}">account creation form</a> again.
49+
and ask the person to please try the
50+
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a> again.
5151

5252
</li>
5353
<li>
@@ -74,8 +74,8 @@ <h1>Add a whitelist entry for account creation.</h1>
7474
<p>
7575

7676
If the answer to this question shows clue, then add the address to the whitelist
77-
using this form, and ask the person to please try the <a href="{% url
78-
'ietf.ietfauth.views.create_account' %}"> account creation form</a> again.
77+
using this form, and ask the person to please try the
78+
<a href="{% url 'ietf.ietfauth.views.create_account' %}"> account creation form</a> again.
7979

8080
</p>
8181
</li>

media/photo/nopictureavailable.jpg

1.58 KB
Loading

media/photo/profile-default.jpg

1.36 KB
Loading

0 commit comments

Comments
 (0)