|
36 | 36 |
|
37 | 37 | import importlib |
38 | 38 |
|
39 | | -from datetime import datetime as DateTime, timedelta as TimeDelta, date as Date |
| 39 | +from datetime import date as Date |
| 40 | +# needed if we revert to higher barrier for account creation |
| 41 | +#from datetime import datetime as DateTime, timedelta as TimeDelta, date as Date |
40 | 42 | from collections import defaultdict |
41 | 43 |
|
42 | 44 | import django.core.signing |
|
65 | 67 | NewEmailForm, ChangeUsernameForm, PersonPasswordForm) |
66 | 68 | from ietf.ietfauth.htpasswd import update_htpasswd_file |
67 | 69 | from ietf.ietfauth.utils import role_required, has_role |
68 | | -from ietf.mailinglists.models import Subscribed, Whitelisted |
| 70 | +from ietf.mailinglists.models import Whitelisted |
| 71 | +# needed if we revert to higher barrier for account creation |
| 72 | +#from ietf.mailinglists.models import Subscribed, Whitelisted |
69 | 73 | from ietf.name.models import ExtResourceName |
70 | 74 | from ietf.nomcom.models import NomCom |
71 | 75 | from ietf.person.models import Person, Email, Alias, PersonalApiKey, PERSON_API_KEY_VALUES |
|
76 | 80 | from ietf.utils.mail import send_mail |
77 | 81 | from ietf.utils.validators import validate_external_resource_value |
78 | 82 |
|
| 83 | +# These are needed if we revert to the higher bar for account creation |
| 84 | + |
| 85 | + |
79 | 86 |
|
80 | 87 | def index(request): |
81 | 88 | return render(request, 'registration/index.html') |
@@ -114,13 +121,19 @@ def create_account(request): |
114 | 121 | form = RegistrationForm(request.POST) |
115 | 122 | if form.is_valid(): |
116 | 123 | to_email = form.cleaned_data['email'] # This will be lowercase if form.is_valid() |
117 | | - existing = Subscribed.objects.filter(email=to_email).first() |
118 | | - ok_to_create = ( Whitelisted.objects.filter(email=to_email).exists() |
119 | | - or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() ) |
120 | | - if ok_to_create: |
121 | | - send_account_creation_email(request, to_email) |
122 | | - else: |
123 | | - return render(request, 'registration/manual.html', { 'account_request_email': settings.ACCOUNT_REQUEST_EMAIL }) |
| 124 | + |
| 125 | + # For the IETF 113 Registration period (at least) we are lowering the barriers for account creation |
| 126 | + # to the simple email round-trip check |
| 127 | + send_account_creation_email(request, to_email) |
| 128 | + |
| 129 | + # The following is what to revert to should that lowered barrier prove problematic |
| 130 | + # existing = Subscribed.objects.filter(email=to_email).first() |
| 131 | + # ok_to_create = ( Whitelisted.objects.filter(email=to_email).exists() |
| 132 | + # or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() ) |
| 133 | + # if ok_to_create: |
| 134 | + # send_account_creation_email(request, to_email) |
| 135 | + # else: |
| 136 | + # return render(request, 'registration/manual.html', { 'account_request_email': settings.ACCOUNT_REQUEST_EMAIL }) |
124 | 137 | else: |
125 | 138 | form = RegistrationForm() |
126 | 139 |
|
|
0 commit comments