Changed some field names from address to email.
- Legacy-Id: 11385
This commit is contained in:
parent
c0ba793c69
commit
016f912ef7
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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={
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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 <a href="{% url
|
||||
'ietf.ietfauth.views.create_account' %}">account creation form</a> again.
|
||||
and ask the person to please try the
|
||||
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a> again.
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
@ -74,8 +74,8 @@
|
|||
<p>
|
||||
|
||||
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 <a href="{% url
|
||||
'ietf.ietfauth.views.create_account' %}"> account creation form</a> again.
|
||||
using this form, and ask the person to please try the
|
||||
<a href="{% url 'ietf.ietfauth.views.create_account' %}"> account creation form</a> again.
|
||||
|
||||
</p>
|
||||
</li>
|
||||
|
|
BIN
media/photo/nopictureavailable.jpg
Normal file
BIN
media/photo/nopictureavailable.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
media/photo/profile-default.jpg
Normal file
BIN
media/photo/profile-default.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in a new issue