chore: Use codespell to fix typos in code. (#4797)
* chore: Use codespell to fix typos in code. Second part of replacement of #4651 @rjsparks, I probably need to revert some things here, and I also still need to add that new migration - how do I do that? * Revert migrations * Migrate "Whitelisted" to "Allowlisted" * TEST_COVERAGE_MASTER_FILE -> TEST_COVERAGE_MAIN_FILE * Fix permissions * Add suggestions from @jennifer-richards
This commit is contained in:
parent
015ac316fb
commit
220be21998
|
@ -80,7 +80,7 @@ class PersonalInformationExportView(DetailView, JsonExportMixin):
|
||||||
person = get_object_or_404(self.model, user=request.user)
|
person = get_object_or_404(self.model, user=request.user)
|
||||||
expand = ['searchrule', 'documentauthor', 'ad_document_set', 'ad_dochistory_set', 'docevent',
|
expand = ['searchrule', 'documentauthor', 'ad_document_set', 'ad_dochistory_set', 'docevent',
|
||||||
'ballotpositiondocevent', 'deletedevent', 'email_set', 'groupevent', 'role', 'rolehistory', 'iprdisclosurebase',
|
'ballotpositiondocevent', 'deletedevent', 'email_set', 'groupevent', 'role', 'rolehistory', 'iprdisclosurebase',
|
||||||
'iprevent', 'liaisonstatementevent', 'whitelisted', 'schedule', 'constraint', 'schedulingevent', 'message',
|
'iprevent', 'liaisonstatementevent', 'allowlisted', 'schedule', 'constraint', 'schedulingevent', 'message',
|
||||||
'sendqueue', 'nominee', 'topicfeedbacklastseen', 'alias', 'email', 'apikeys', 'personevent',
|
'sendqueue', 'nominee', 'topicfeedbacklastseen', 'alias', 'email', 'apikeys', 'personevent',
|
||||||
'reviewersettings', 'reviewsecretarysettings', 'unavailableperiod', 'reviewwish',
|
'reviewersettings', 'reviewsecretarysettings', 'unavailableperiod', 'reviewwish',
|
||||||
'nextreviewerinteam', 'reviewrequest', 'meetingregistration', 'submissionevent', 'preapproval',
|
'nextreviewerinteam', 'reviewrequest', 'meetingregistration', 'submissionevent', 'preapproval',
|
||||||
|
|
|
@ -166,7 +166,7 @@ Thank you,</field>
|
||||||
Thank you for accepting your nomination for the position of $position.
|
Thank you for accepting your nomination for the position of $position.
|
||||||
|
|
||||||
Please remember to complete and return the questionnaire for this position at your earliest opportunity.
|
Please remember to complete and return the questionnaire for this position at your earliest opportunity.
|
||||||
The questionaire is repeated below for your convenience.
|
The questionnaire is repeated below for your convenience.
|
||||||
|
|
||||||
--------</field>
|
--------</field>
|
||||||
<field to="group.group" name="group" rel="ManyToOneRel"><None></None></field>
|
<field to="group.group" name="group" rel="ManyToOneRel"><None></None></field>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<dd>{{ template.type.name }}
|
<dd>{{ template.type.name }}
|
||||||
{% if template.type.slug == "rst" %}
|
{% if template.type.slug == "rst" %}
|
||||||
<p class="help-block">This template uses the syntax of reStructuredText. Get a quick reference at <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">http://docutils.sourceforge.net/docs/user/rst/quickref.html</a>.</p>
|
<p class="help-block">This template uses the syntax of reStructuredText. Get a quick reference at <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">http://docutils.sourceforge.net/docs/user/rst/quickref.html</a>.</p>
|
||||||
<p class="help-block">You can do variable interpolation with $varialbe if the template allows any variable.</p>
|
<p class="help-block">You can do variable interpolation with $variable if the template allows any variable.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if template.type.slug == "django" %}
|
{% if template.type.slug == "django" %}
|
||||||
<p class="help-block">This template uses the syntax of the default django template framework. Get more info at <a href="https://docs.djangoproject.com/en/dev/topics/templates/">https://docs.djangoproject.com/en/dev/topics/templates/</a>.</p>
|
<p class="help-block">This template uses the syntax of the default django template framework. Get more info at <a href="https://docs.djangoproject.com/en/dev/topics/templates/">https://docs.djangoproject.com/en/dev/topics/templates/</a>.</p>
|
||||||
|
@ -43,4 +43,4 @@
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -15,7 +15,7 @@
|
||||||
<dd>{{ template.type.name }}
|
<dd>{{ template.type.name }}
|
||||||
{% if template.type.slug == "rst" %}
|
{% if template.type.slug == "rst" %}
|
||||||
<p class="help-block">This template uses the syntax of reStructuredText. Get a quick reference at <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">http://docutils.sourceforge.net/docs/user/rst/quickref.html</a>.</p>
|
<p class="help-block">This template uses the syntax of reStructuredText. Get a quick reference at <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">http://docutils.sourceforge.net/docs/user/rst/quickref.html</a>.</p>
|
||||||
<p class="help-block">You can do variable interpolation with $varialbe if the template allows any variable.</p>
|
<p class="help-block">You can do variable interpolation with $variable if the template allows any variable.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if template.type.slug == "django" %}
|
{% if template.type.slug == "django" %}
|
||||||
<p class="help-block">This template uses the syntax of the default django template framework. Get more info at <a href="https://docs.djangoproject.com/en/dev/topics/templates/">https://docs.djangoproject.com/en/dev/topics/templates/</a>.</p>
|
<p class="help-block">This template uses the syntax of the default django template framework. Get more info at <a href="https://docs.djangoproject.com/en/dev/topics/templates/">https://docs.djangoproject.com/en/dev/topics/templates/</a>.</p>
|
||||||
|
@ -37,4 +37,4 @@
|
||||||
<pre class="pasted">{{ template.content|escape }}</pre>
|
<pre class="pasted">{{ template.content|escape }}</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -489,7 +489,7 @@ Table of Contents
|
||||||
1. Introduction
|
1. Introduction
|
||||||
|
|
||||||
This document describes how to make the Martian networks work. The
|
This document describes how to make the Martian networks work. The
|
||||||
methods used in Earth do not directly translate to the efficent
|
methods used in Earth do not directly translate to the efficient
|
||||||
networks on Mars, as the topographical differences caused by planets.
|
networks on Mars, as the topographical differences caused by planets.
|
||||||
For example the avian carriers, cannot be used in the Mars, thus
|
For example the avian carriers, cannot be used in the Mars, thus
|
||||||
RFC1149 ([RFC1149]) cannot be used in Mars.
|
RFC1149 ([RFC1149]) cannot be used in Mars.
|
||||||
|
|
|
@ -133,15 +133,15 @@ class Group(GroupInfo):
|
||||||
role_names = [role_names]
|
role_names = [role_names]
|
||||||
return user.is_authenticated and self.role_set.filter(name__in=role_names, person__user=user).exists()
|
return user.is_authenticated and self.role_set.filter(name__in=role_names, person__user=user).exists()
|
||||||
|
|
||||||
def is_decendant_of(self, sought_parent):
|
def is_descendant_of(self, sought_parent):
|
||||||
parent = self.parent
|
parent = self.parent
|
||||||
decendants = [ self, ]
|
descendants = [ self, ]
|
||||||
while (parent != None) and (parent not in decendants):
|
while (parent != None) and (parent not in descendants):
|
||||||
decendants = [ parent ] + decendants
|
descendants = [ parent ] + descendants
|
||||||
if parent.acronym == sought_parent:
|
if parent.acronym == sought_parent:
|
||||||
return True
|
return True
|
||||||
parent = parent.parent
|
parent = parent.parent
|
||||||
log.assertion('parent not in decendants')
|
log.assertion('parent not in descendants')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_chair(self):
|
def get_chair(self):
|
||||||
|
|
|
@ -1937,12 +1937,12 @@ class GroupParentLoopTests(TestCase):
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
def timeout_handler(signum, frame):
|
def timeout_handler(signum, frame):
|
||||||
raise Exception("Infinite loop in parent links is not handeled properly.")
|
raise Exception("Infinite loop in parent links is not handled properly.")
|
||||||
|
|
||||||
signal.signal(signal.SIGALRM, timeout_handler)
|
signal.signal(signal.SIGALRM, timeout_handler)
|
||||||
signal.alarm(1) # One second
|
signal.alarm(1) # One second
|
||||||
try:
|
try:
|
||||||
test2.is_decendant_of("ietf")
|
test2.is_descendant_of("ietf")
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
pass
|
pass
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
@ -18,7 +18,7 @@ from django_password_strength.widgets import PasswordStrengthInput, PasswordConf
|
||||||
import debug # pyflakes:ignore
|
import debug # pyflakes:ignore
|
||||||
|
|
||||||
from ietf.person.models import Person, Email
|
from ietf.person.models import Person, Email
|
||||||
from ietf.mailinglists.models import Whitelisted
|
from ietf.mailinglists.models import Allowlisted
|
||||||
from ietf.utils.text import isascii
|
from ietf.utils.text import isascii
|
||||||
|
|
||||||
class RegistrationForm(forms.Form):
|
class RegistrationForm(forms.Form):
|
||||||
|
@ -203,9 +203,9 @@ class ResetPasswordForm(forms.Form):
|
||||||
class TestEmailForm(forms.Form):
|
class TestEmailForm(forms.Form):
|
||||||
email = forms.EmailField(required=False)
|
email = forms.EmailField(required=False)
|
||||||
|
|
||||||
class WhitelistForm(forms.ModelForm):
|
class AllowlistForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Whitelisted
|
model = Allowlisted
|
||||||
exclude = ['by', 'time' ]
|
exclude = ['by', 'time' ]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ class IetfAuthTests(TestCase):
|
||||||
|
|
||||||
self.assertTrue(self.username_in_htpasswd_file(email))
|
self.assertTrue(self.username_in_htpasswd_file(email))
|
||||||
|
|
||||||
def test_create_whitelisted_account(self):
|
def test_create_allowlisted_account(self):
|
||||||
email = "new-account@example.com"
|
email = "new-account@example.com"
|
||||||
|
|
||||||
# add allowlist entry
|
# add allowlist entry
|
||||||
|
@ -202,13 +202,13 @@ class IetfAuthTests(TestCase):
|
||||||
self.assertEqual(r.status_code, 302)
|
self.assertEqual(r.status_code, 302)
|
||||||
self.assertEqual(urlsplit(r["Location"])[2], urlreverse(ietf.ietfauth.views.profile))
|
self.assertEqual(urlsplit(r["Location"])[2], urlreverse(ietf.ietfauth.views.profile))
|
||||||
|
|
||||||
r = self.client.get(urlreverse(ietf.ietfauth.views.add_account_whitelist))
|
r = self.client.get(urlreverse(ietf.ietfauth.views.add_account_allowlist))
|
||||||
self.assertEqual(r.status_code, 200)
|
self.assertEqual(r.status_code, 200)
|
||||||
self.assertContains(r, "Add a whitelist entry")
|
self.assertContains(r, "Add an allowlist entry")
|
||||||
|
|
||||||
r = self.client.post(urlreverse(ietf.ietfauth.views.add_account_whitelist), {"email": email})
|
r = self.client.post(urlreverse(ietf.ietfauth.views.add_account_allowlist), {"email": email})
|
||||||
self.assertEqual(r.status_code, 200)
|
self.assertEqual(r.status_code, 200)
|
||||||
self.assertContains(r, "Whitelist entry creation successful")
|
self.assertContains(r, "Allowlist entry creation successful")
|
||||||
|
|
||||||
# log out
|
# log out
|
||||||
r = self.client.get(urlreverse('django.contrib.auth.views.logout'))
|
r = self.client.get(urlreverse('django.contrib.auth.views.logout'))
|
||||||
|
|
|
@ -24,5 +24,5 @@ urlpatterns = [
|
||||||
url(r'^review/$', views.review_overview),
|
url(r'^review/$', views.review_overview),
|
||||||
url(r'^testemail/$', views.test_email),
|
url(r'^testemail/$', views.test_email),
|
||||||
url(r'^username/$', views.change_username),
|
url(r'^username/$', views.change_username),
|
||||||
url(r'^whitelist/add/?$', views.add_account_whitelist),
|
url(r'^allowlist/add/?$', views.add_account_allowlist),
|
||||||
]
|
]
|
||||||
|
|
|
@ -62,13 +62,11 @@ import debug # pyflakes:ignore
|
||||||
|
|
||||||
from ietf.group.models import Role, Group
|
from ietf.group.models import Role, Group
|
||||||
from ietf.ietfauth.forms import ( RegistrationForm, PasswordForm, ResetPasswordForm, TestEmailForm,
|
from ietf.ietfauth.forms import ( RegistrationForm, PasswordForm, ResetPasswordForm, TestEmailForm,
|
||||||
WhitelistForm, ChangePasswordForm, get_person_form, RoleEmailForm,
|
AllowlistForm, ChangePasswordForm, get_person_form, RoleEmailForm,
|
||||||
NewEmailForm, ChangeUsernameForm, PersonPasswordForm)
|
NewEmailForm, ChangeUsernameForm, PersonPasswordForm)
|
||||||
from ietf.ietfauth.htpasswd import update_htpasswd_file
|
from ietf.ietfauth.htpasswd import update_htpasswd_file
|
||||||
from ietf.ietfauth.utils import role_required, has_role
|
from ietf.ietfauth.utils import role_required, has_role
|
||||||
from ietf.mailinglists.models import Whitelisted
|
from ietf.mailinglists.models import Allowlisted
|
||||||
# needed if we revert to higher barrier for account creation
|
|
||||||
#from ietf.mailinglists.models import Subscribed, Whitelisted
|
|
||||||
from ietf.name.models import ExtResourceName
|
from ietf.name.models import ExtResourceName
|
||||||
from ietf.nomcom.models import NomCom
|
from ietf.nomcom.models import NomCom
|
||||||
from ietf.person.models import Person, Email, Alias, PersonalApiKey, PERSON_API_KEY_VALUES
|
from ietf.person.models import Person, Email, Alias, PersonalApiKey, PERSON_API_KEY_VALUES
|
||||||
|
@ -128,7 +126,7 @@ def create_account(request):
|
||||||
|
|
||||||
# The following is what to revert to should that lowered barrier prove problematic
|
# The following is what to revert to should that lowered barrier prove problematic
|
||||||
# existing = Subscribed.objects.filter(email=to_email).first()
|
# existing = Subscribed.objects.filter(email=to_email).first()
|
||||||
# ok_to_create = ( Whitelisted.objects.filter(email=to_email).exists()
|
# ok_to_create = ( Allowlisted.objects.filter(email=to_email).exists()
|
||||||
# or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() )
|
# or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() )
|
||||||
# if ok_to_create:
|
# if ok_to_create:
|
||||||
# send_account_creation_email(request, to_email)
|
# send_account_creation_email(request, to_email)
|
||||||
|
@ -522,19 +520,19 @@ def test_email(request):
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@role_required('Secretariat')
|
@role_required('Secretariat')
|
||||||
def add_account_whitelist(request):
|
def add_account_allowlist(request):
|
||||||
success = False
|
success = False
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = WhitelistForm(request.POST)
|
form = AllowlistForm(request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
email = form.cleaned_data['email']
|
email = form.cleaned_data['email']
|
||||||
entry = Whitelisted(email=email, by=request.user.person)
|
entry = Allowlisted(email=email, by=request.user.person)
|
||||||
entry.save()
|
entry.save()
|
||||||
success = True
|
success = True
|
||||||
else:
|
else:
|
||||||
form = WhitelistForm()
|
form = AllowlistForm()
|
||||||
|
|
||||||
return render(request, 'ietfauth/whitelist_form.html', {
|
return render(request, 'ietfauth/allowlist_form.html', {
|
||||||
'form': form,
|
'form': form,
|
||||||
'success': success,
|
'success': success,
|
||||||
})
|
})
|
||||||
|
|
|
@ -134,7 +134,7 @@ class IprTests(TestCase):
|
||||||
def test_search(self):
|
def test_search(self):
|
||||||
WgDraftFactory() # The test matching the prefix "draft" needs more than one thing to find
|
WgDraftFactory() # The test matching the prefix "draft" needs more than one thing to find
|
||||||
draft = WgDraftFactory()
|
draft = WgDraftFactory()
|
||||||
ipr = HolderIprDisclosureFactory(docs=[draft,],patent_info='Number: US12345\nTitle: A method of transfering bits\nInventor: A. Nonymous\nDate: 2000-01-01')
|
ipr = HolderIprDisclosureFactory(docs=[draft,],patent_info='Number: US12345\nTitle: A method of transferring bits\nInventor: A. Nonymous\nDate: 2000-01-01')
|
||||||
|
|
||||||
url = urlreverse("ietf.ipr.views.search")
|
url = urlreverse("ietf.ipr.views.search")
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ class IprTests(TestCase):
|
||||||
"iprdocrel_set-1-document": DocAlias.objects.filter(name__startswith="rfc").first().pk,
|
"iprdocrel_set-1-document": DocAlias.objects.filter(name__startswith="rfc").first().pk,
|
||||||
"patent_number": "SE12345678901",
|
"patent_number": "SE12345678901",
|
||||||
"patent_inventor": "A. Nonymous",
|
"patent_inventor": "A. Nonymous",
|
||||||
"patent_title": "A method of transfering bits",
|
"patent_title": "A method of transferring bits",
|
||||||
"patent_date": "2000-01-01",
|
"patent_date": "2000-01-01",
|
||||||
"has_patent_pending": False,
|
"has_patent_pending": False,
|
||||||
"licensing": "royalty-free",
|
"licensing": "royalty-free",
|
||||||
|
@ -277,7 +277,7 @@ class IprTests(TestCase):
|
||||||
ipr = iprs[0]
|
ipr = iprs[0]
|
||||||
self.assertEqual(ipr.holder_legal_name, "Test Legal")
|
self.assertEqual(ipr.holder_legal_name, "Test Legal")
|
||||||
self.assertEqual(ipr.state.slug, 'pending')
|
self.assertEqual(ipr.state.slug, 'pending')
|
||||||
for item in ['SE12345678901','A method of transfering bits','2000-01-01']:
|
for item in ['SE12345678901','A method of transferring bits','2000-01-01']:
|
||||||
self.assertIn(item, ipr.get_child().patent_info)
|
self.assertIn(item, ipr.get_child().patent_info)
|
||||||
self.assertTrue(isinstance(ipr.get_child(),HolderIprDisclosure))
|
self.assertTrue(isinstance(ipr.get_child(),HolderIprDisclosure))
|
||||||
self.assertEqual(len(outbox),1)
|
self.assertEqual(len(outbox),1)
|
||||||
|
@ -318,7 +318,7 @@ class IprTests(TestCase):
|
||||||
"iprdocrel_set-1-document": DocAlias.objects.filter(name__startswith="rfc").first().pk,
|
"iprdocrel_set-1-document": DocAlias.objects.filter(name__startswith="rfc").first().pk,
|
||||||
"patent_number": "SE12345678901",
|
"patent_number": "SE12345678901",
|
||||||
"patent_inventor": "A. Nonymous",
|
"patent_inventor": "A. Nonymous",
|
||||||
"patent_title": "A method of transfering bits",
|
"patent_title": "A method of transferring bits",
|
||||||
"patent_date": "2000-01-01",
|
"patent_date": "2000-01-01",
|
||||||
"has_patent_pending": False,
|
"has_patent_pending": False,
|
||||||
"licensing": "royalty-free",
|
"licensing": "royalty-free",
|
||||||
|
@ -332,7 +332,7 @@ class IprTests(TestCase):
|
||||||
ipr = iprs[0]
|
ipr = iprs[0]
|
||||||
self.assertEqual(ipr.holder_legal_name, "Test Legal")
|
self.assertEqual(ipr.holder_legal_name, "Test Legal")
|
||||||
self.assertEqual(ipr.state.slug, "pending")
|
self.assertEqual(ipr.state.slug, "pending")
|
||||||
for item in ['SE12345678901','A method of transfering bits','2000-01-01' ]:
|
for item in ['SE12345678901','A method of transferring bits','2000-01-01' ]:
|
||||||
self.assertIn(item, ipr.get_child().patent_info)
|
self.assertIn(item, ipr.get_child().patent_info)
|
||||||
self.assertTrue(isinstance(ipr.get_child(),ThirdPartyIprDisclosure))
|
self.assertTrue(isinstance(ipr.get_child(),ThirdPartyIprDisclosure))
|
||||||
self.assertEqual(len(outbox),1)
|
self.assertEqual(len(outbox),1)
|
||||||
|
@ -368,7 +368,7 @@ class IprTests(TestCase):
|
||||||
"patent_date": "2000-01-01",
|
"patent_date": "2000-01-01",
|
||||||
"patent_inventor": "A. Nonymous",
|
"patent_inventor": "A. Nonymous",
|
||||||
"patent_number": "SE12345678901",
|
"patent_number": "SE12345678901",
|
||||||
"patent_title": "A method of transfering bits",
|
"patent_title": "A method of transferring bits",
|
||||||
"submitter_email": "test@holder.com",
|
"submitter_email": "test@holder.com",
|
||||||
"submitter_name": "Test Holder",
|
"submitter_name": "Test Holder",
|
||||||
"updates": [],
|
"updates": [],
|
||||||
|
@ -414,7 +414,7 @@ class IprTests(TestCase):
|
||||||
"iprdocrel_set-1-document": DocAlias.objects.filter(name__startswith="rfc").first().pk,
|
"iprdocrel_set-1-document": DocAlias.objects.filter(name__startswith="rfc").first().pk,
|
||||||
"patent_number": "SE12345678901",
|
"patent_number": "SE12345678901",
|
||||||
"patent_inventor": "A. Nonymous",
|
"patent_inventor": "A. Nonymous",
|
||||||
"patent_title": "A method of transfering bits",
|
"patent_title": "A method of transferring bits",
|
||||||
"patent_date": "2000-01-01",
|
"patent_date": "2000-01-01",
|
||||||
"has_patent_pending": False,
|
"has_patent_pending": False,
|
||||||
"licensing": "royalty-free",
|
"licensing": "royalty-free",
|
||||||
|
@ -450,7 +450,7 @@ class IprTests(TestCase):
|
||||||
"iprdocrel_set-0-revisions": '00',
|
"iprdocrel_set-0-revisions": '00',
|
||||||
"patent_number": "SE12345678901",
|
"patent_number": "SE12345678901",
|
||||||
"patent_inventor": "A. Nonymous",
|
"patent_inventor": "A. Nonymous",
|
||||||
"patent_title": "A method of transfering bits",
|
"patent_title": "A method of transferring bits",
|
||||||
"patent_date": "2000-01-01",
|
"patent_date": "2000-01-01",
|
||||||
"has_patent_pending": False,
|
"has_patent_pending": False,
|
||||||
"licensing": "royalty-free",
|
"licensing": "royalty-free",
|
||||||
|
@ -753,4 +753,4 @@ Subject: test
|
||||||
removed_docevent = doc.docevent_set.filter(type='removed_related_ipr').first()
|
removed_docevent = doc.docevent_set.filter(type='removed_related_ipr').first()
|
||||||
self.assertIn(ipr.title, removed_docevent.desc,
|
self.assertIn(ipr.title, removed_docevent.desc,
|
||||||
'IprDisclosure title does not appear in DocEvent desc when removed')
|
'IprDisclosure title does not appear in DocEvent desc when removed')
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from ietf.mailinglists.models import List, Subscribed, Whitelisted
|
from ietf.mailinglists.models import List, Subscribed, Allowlisted
|
||||||
|
|
||||||
|
|
||||||
class ListAdmin(admin.ModelAdmin):
|
class ListAdmin(admin.ModelAdmin):
|
||||||
|
@ -18,6 +18,6 @@ class SubscribedAdmin(admin.ModelAdmin):
|
||||||
admin.site.register(Subscribed, SubscribedAdmin)
|
admin.site.register(Subscribed, SubscribedAdmin)
|
||||||
|
|
||||||
|
|
||||||
class WhitelistedAdmin(admin.ModelAdmin):
|
class AllowlistedAdmin(admin.ModelAdmin):
|
||||||
list_display = ('id', 'time', 'email', 'by')
|
list_display = ('id', 'time', 'email', 'by')
|
||||||
admin.site.register(Whitelisted, WhitelistedAdmin)
|
admin.site.register(Allowlisted, AllowlistedAdmin)
|
||||||
|
|
22
ietf/mailinglists/migrations/0003_allowlisted.py
Normal file
22
ietf/mailinglists/migrations/0003_allowlisted.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Generated by Django 2.2.28 on 2022-12-05 14:26
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('person', '0029_use_timezone_now_for_person_models'),
|
||||||
|
('mailinglists', '0002_auto_20190703_1344'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameModel(
|
||||||
|
old_name='Whitelisted',
|
||||||
|
new_name='Allowlisted',
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='allowlisted',
|
||||||
|
options={'verbose_name_plural': 'Allowlisted'},
|
||||||
|
),
|
||||||
|
]
|
|
@ -28,12 +28,12 @@ class Subscribed(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name_plural = "Subscribed"
|
verbose_name_plural = "Subscribed"
|
||||||
|
|
||||||
class Whitelisted(models.Model):
|
class Allowlisted(models.Model):
|
||||||
time = models.DateTimeField(auto_now_add=True)
|
time = models.DateTimeField(auto_now_add=True)
|
||||||
email = models.CharField("Email address", max_length=64, validators=[validate_email])
|
email = models.CharField("Email address", max_length=64, validators=[validate_email])
|
||||||
by = ForeignKey(Person)
|
by = ForeignKey(Person)
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "<Whitelisted: %s at %s>" % (self.email, self.time)
|
return "<Allowlisted: %s at %s>" % (self.email, self.time)
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name_plural = "Whitelisted"
|
verbose_name_plural = "Allowlisted"
|
||||||
|
|
||||||
|
|
|
@ -11,17 +11,17 @@ from tastypie.cache import SimpleCache
|
||||||
from ietf import api
|
from ietf import api
|
||||||
from ietf.api import ToOneField # pyflakes:ignore
|
from ietf.api import ToOneField # pyflakes:ignore
|
||||||
|
|
||||||
from ietf.mailinglists.models import Whitelisted, List, Subscribed
|
from ietf.mailinglists.models import Allowlisted, List, Subscribed
|
||||||
|
|
||||||
|
|
||||||
from ietf.person.resources import PersonResource
|
from ietf.person.resources import PersonResource
|
||||||
class WhitelistedResource(ModelResource):
|
class AllowlistedResource(ModelResource):
|
||||||
by = ToOneField(PersonResource, 'by')
|
by = ToOneField(PersonResource, 'by')
|
||||||
class Meta:
|
class Meta:
|
||||||
queryset = Whitelisted.objects.all()
|
queryset = Allowlisted.objects.all()
|
||||||
serializer = api.Serializer()
|
serializer = api.Serializer()
|
||||||
cache = SimpleCache()
|
cache = SimpleCache()
|
||||||
#resource_name = 'whitelisted'
|
#resource_name = 'allowlisted'
|
||||||
ordering = ['id', ]
|
ordering = ['id', ]
|
||||||
filtering = {
|
filtering = {
|
||||||
"id": ALL,
|
"id": ALL,
|
||||||
|
@ -29,7 +29,7 @@ class WhitelistedResource(ModelResource):
|
||||||
"email": ALL,
|
"email": ALL,
|
||||||
"by": ALL_WITH_RELATIONS,
|
"by": ALL_WITH_RELATIONS,
|
||||||
}
|
}
|
||||||
api.mailinglists.register(WhitelistedResource())
|
api.mailinglists.register(AllowlistedResource())
|
||||||
|
|
||||||
class ListResource(ModelResource):
|
class ListResource(ModelResource):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -385,7 +385,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fields": {
|
"fields": {
|
||||||
"desc": "The document is in the RFC editor Queue (as confirmed by http://www.rfc-editor.org/queue.html).",
|
"desc": "The document is in the RFC editor Queue (as confirmed by https://www.rfc-editor.org/queue.html).",
|
||||||
"name": "RFC Ed Queue",
|
"name": "RFC Ed Queue",
|
||||||
"next_states": [
|
"next_states": [
|
||||||
7
|
7
|
||||||
|
@ -2585,7 +2585,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fields": {
|
"fields": {
|
||||||
"label": "Liason Statement State"
|
"label": "Liaison Statement State"
|
||||||
},
|
},
|
||||||
"model": "doc.statetype",
|
"model": "doc.statetype",
|
||||||
"pk": "liaison"
|
"pk": "liaison"
|
||||||
|
@ -3844,7 +3844,7 @@
|
||||||
{
|
{
|
||||||
"fields": {
|
"fields": {
|
||||||
"cc": [],
|
"cc": [],
|
||||||
"desc": "Recipients for message to adminstrators when a charter state edit needs followon administrative action",
|
"desc": "Recipients for message to administrators when a charter state edit needs follow-on administrative action",
|
||||||
"to": [
|
"to": [
|
||||||
"iesg_secretary"
|
"iesg_secretary"
|
||||||
]
|
]
|
||||||
|
@ -5909,7 +5909,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fields": {
|
"fields": {
|
||||||
"desc": "The set of people who can approve this liasion statemetns",
|
"desc": "The set of people who can approve this liaison statements",
|
||||||
"template": "{{liaison.approver_emails|join:\", \"}}"
|
"template": "{{liaison.approver_emails|join:\", \"}}"
|
||||||
},
|
},
|
||||||
"model": "mailtrigger.recipient",
|
"model": "mailtrigger.recipient",
|
||||||
|
|
|
@ -175,7 +175,7 @@ class MergeNomineeForm(forms.Form):
|
||||||
secondary_emails = self.cleaned_data.get("secondary_emails")
|
secondary_emails = self.cleaned_data.get("secondary_emails")
|
||||||
if primary_email and secondary_emails:
|
if primary_email and secondary_emails:
|
||||||
if primary_email in secondary_emails:
|
if primary_email in secondary_emails:
|
||||||
msg = "Primary and secondary email address must be differents"
|
msg = "Primary and secondary email address must be different"
|
||||||
self._errors["primary_email"] = self.error_class([msg])
|
self._errors["primary_email"] = self.error_class([msg])
|
||||||
return self.cleaned_data
|
return self.cleaned_data
|
||||||
|
|
||||||
|
@ -865,4 +865,4 @@ class VolunteerForm(forms.ModelForm):
|
||||||
self.fields['nomcoms'].queryset = NomCom.objects.filter(is_accepting_volunteers=True).exclude(volunteer__person=person)
|
self.fields['nomcoms'].queryset = NomCom.objects.filter(is_accepting_volunteers=True).exclude(volunteer__person=person)
|
||||||
self.fields['nomcoms'].help_text = 'You may volunteer even if the datatracker does not currently calculate that you are eligible. Eligibility will be assessed when the selection process is performed.'
|
self.fields['nomcoms'].help_text = 'You may volunteer even if the datatracker does not currently calculate that you are eligible. Eligibility will be assessed when the selection process is performed.'
|
||||||
self.fields['affiliation'].help_text = 'Affiliation to show in the volunteer list'
|
self.fields['affiliation'].help_text = 'Affiliation to show in the volunteer list'
|
||||||
self.fields['affiliation'].required = True
|
self.fields['affiliation'].required = True
|
||||||
|
|
|
@ -84,7 +84,7 @@ class Command(BaseCommand):
|
||||||
email.origin = email.person.user.username if email.person.user_id else ('script: %s deactivation' % options['reason'])
|
email.origin = email.person.user.username if email.person.user_id else ('script: %s deactivation' % options['reason'])
|
||||||
email.save()
|
email.save()
|
||||||
PersonEvent.objects.create(person=email.person, type='email_address_deactivated',
|
PersonEvent.objects.create(person=email.person, type='email_address_deactivated',
|
||||||
desc="Deactivated the email addres <%s>. Reason: %s" % (email.address, options['reason']) )
|
desc="Deactivated the email address <%s>. Reason: %s" % (email.address, options['reason']) )
|
||||||
else:
|
else:
|
||||||
if email is None:
|
if email is None:
|
||||||
not_found.append(a)
|
not_found.append(a)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<input type="radio" name="wg_action_status" value="2"> External Review NOT APPROVED;
|
<input type="radio" name="wg_action_status" value="2"> External Review NOT APPROVED;
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<input type="radio" name="wg_action_status_sub" value="1"> The Secretariat will wait for instructions from <select name="note_draft_by"></select><br>
|
<input type="radio" name="wg_action_status_sub" value="1"> The Secretariat will wait for instructions from <select name="note_draft_by"></select><br>
|
||||||
<input type="radio" name="wg_action_status_sub" value="2"> The IESG decides the document needs more thime in INTERNAL REVIEW. The Secreatriat will put it back on the agenda for the next teleconference in the same category.<br>
|
<input type="radio" name="wg_action_status_sub" value="2"> The IESG decides the document needs more time in INTERNAL REVIEW. The Secretariat will put it back on the agenda for the next teleconference in the same category.<br>
|
||||||
<input type="radio" name="wg_action_status_sub" value="3"> The IESG has made changes since the charter was seen in INTERNAL REVIEW, and decides to send it back to INTERNAL REVIEW the charter again.
|
<input type="radio" name="wg_action_status_sub" value="3"> The IESG has made changes since the charter was seen in INTERNAL REVIEW, and decides to send it back to INTERNAL REVIEW the charter again.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -30,4 +30,4 @@
|
||||||
<input type="radio" name="wg_action_status" value="2"> Yes, the charter is NOT APPROVED; The charter needs more work, or the IESG decides to shelve formation of the working group. "The Secretariat will await further instruction from <select name="note_draft_by"></select> regarding the rechartering of this working group."<br><br>
|
<input type="radio" name="wg_action_status" value="2"> Yes, the charter is NOT APPROVED; The charter needs more work, or the IESG decides to shelve formation of the working group. "The Secretariat will await further instruction from <select name="note_draft_by"></select> regarding the rechartering of this working group."<br><br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</form>
|
</form>
|
|
@ -610,7 +610,7 @@ TEST_TEMPLATE_IGNORE = [
|
||||||
"500.html" # isn't loaded by regular loader, but checked by test_500_page()
|
"500.html" # isn't loaded by regular loader, but checked by test_500_page()
|
||||||
]
|
]
|
||||||
|
|
||||||
TEST_COVERAGE_MASTER_FILE = os.path.join(BASE_DIR, "../release-coverage.json")
|
TEST_COVERAGE_MAIN_FILE = os.path.join(BASE_DIR, "../release-coverage.json")
|
||||||
TEST_COVERAGE_LATEST_FILE = os.path.join(BASE_DIR, "../latest-coverage.json")
|
TEST_COVERAGE_LATEST_FILE = os.path.join(BASE_DIR, "../latest-coverage.json")
|
||||||
|
|
||||||
TEST_CODE_COVERAGE_CHECKER = None
|
TEST_CODE_COVERAGE_CHECKER = None
|
||||||
|
@ -680,7 +680,7 @@ INTERNET_ALL_DRAFTS_ARCHIVE_DIR = '/a/ietfdata/doc/draft/archive'
|
||||||
MEETING_RECORDINGS_DIR = '/a/www/audio'
|
MEETING_RECORDINGS_DIR = '/a/www/audio'
|
||||||
DERIVED_DIR = '/a/ietfdata/derived'
|
DERIVED_DIR = '/a/ietfdata/derived'
|
||||||
|
|
||||||
DOCUMENT_FORMAT_WHITELIST = ["txt", "ps", "pdf", "xml", "html", ]
|
DOCUMENT_FORMAT_ALLOWLIST = ["txt", "ps", "pdf", "xml", "html", ]
|
||||||
|
|
||||||
# Mailing list info URL for lists hosted on the IETF servers
|
# Mailing list info URL for lists hosted on the IETF servers
|
||||||
MAILING_LIST_INFO_URL = "https://www.ietf.org/mailman/listinfo/%(list_addr)s"
|
MAILING_LIST_INFO_URL = "https://www.ietf.org/mailman/listinfo/%(list_addr)s"
|
||||||
|
|
|
@ -315,7 +315,7 @@ function draw_graph(data, group) {
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
// // See https://github.com/d3/d3-force/blob/master/README.md#simulation_tick
|
// // See https://github.com/d3/d3-force/blob/main/README.md#simulation_tick
|
||||||
// for (let i = 0, n = Math.ceil(Math.log(simulation.alphaMin()) /
|
// for (let i = 0, n = Math.ceil(Math.log(simulation.alphaMin()) /
|
||||||
// Math.log(1 - simulation.alphaDecay())); i <
|
// Math.log(1 - simulation.alphaDecay())); i <
|
||||||
// n; ++i) {
|
// n; ++i) {
|
||||||
|
|
|
@ -345,7 +345,7 @@ def document_stats(request, stats_type=None):
|
||||||
|
|
||||||
basename, ext = t
|
basename, ext = t
|
||||||
ext = ext.lower()
|
ext = ext.lower()
|
||||||
if not any(ext==whitelisted_ext for whitelisted_ext in settings.DOCUMENT_FORMAT_WHITELIST):
|
if not any(ext==allowlisted_ext for allowlisted_ext in settings.DOCUMENT_FORMAT_ALLOWLIST):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
canonical_name = doc_names_with_missing_types.get(basename)
|
canonical_name = doc_names_with_missing_types.get(basename)
|
||||||
|
|
|
@ -338,7 +338,7 @@ class SubmissionBaseUploadForm(forms.Form):
|
||||||
if group:
|
if group:
|
||||||
return group
|
return group
|
||||||
else:
|
else:
|
||||||
raise forms.ValidationError('Draft names starting with draft-%s- are restricted, please pick a differen name' % ntype)
|
raise forms.ValidationError('Draft names starting with draft-%s- are restricted, please pick a different name' % ntype)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -567,7 +567,7 @@ def post_approved_draft(url, name):
|
||||||
"Authorization": "Basic %s" % force_str(base64.encodebytes(smart_bytes("%s:%s" % (username, password)))).replace("\n", ""),
|
"Authorization": "Basic %s" % force_str(base64.encodebytes(smart_bytes("%s:%s" % (username, password)))).replace("\n", ""),
|
||||||
}
|
}
|
||||||
|
|
||||||
log("Posting RFC-Editor notifcation of approved draft '%s' to '%s'" % (name, url))
|
log("Posting RFC-Editor notification of approved draft '%s' to '%s'" % (name, url))
|
||||||
text = error = ""
|
text = error = ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -186,8 +186,8 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item {% if flavor != 'top' %} text-wrap link-primary{% endif %}"
|
<a class="dropdown-item {% if flavor != 'top' %} text-wrap link-primary{% endif %}"
|
||||||
href="{% url 'ietf.ietfauth.views.add_account_whitelist' %}">
|
href="{% url 'ietf.ietfauth.views.add_account_allowlist' %}">
|
||||||
Account whitelist
|
Account allowlist
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% autoescape off %}As you requsted, the Internet Draft {{ doc.file_tag }}
|
{% autoescape off %}As you requested, the Internet Draft {{ doc.file_tag }}
|
||||||
has been resurrected.
|
has been resurrected.
|
||||||
|
|
||||||
Datatracker URL: {{ url }}
|
Datatracker URL: {{ url }}
|
||||||
|
|
|
@ -6,18 +6,18 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% origin %}
|
{% origin %}
|
||||||
{% if success %}
|
{% if success %}
|
||||||
<h1>Whitelist entry creation successful</h1>
|
<h1>Allowlist entry creation successful</h1>
|
||||||
<p>
|
<p>
|
||||||
Please ask the requestor to try the
|
Please ask the requestor to try the
|
||||||
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a>
|
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a>
|
||||||
again, with the whitelisted email address.
|
again, with the allowlisted email address.
|
||||||
</p>
|
</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1>Add a whitelist entry for account creation.</h1>
|
<h1>Add an allowlist entry for account creation.</h1>
|
||||||
<p>
|
<p>
|
||||||
When an email request comes in for assistance with account creation
|
When an email request comes in for assistance with account creation
|
||||||
because the automated account creation has failed, you can add the
|
because the automated account creation has failed, you can add the
|
||||||
address to an account creation whitelist here.
|
address to an account creation allowlist here.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Before you do so, please complete the following 3 verification steps:
|
Before you do so, please complete the following 3 verification steps:
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
<li>
|
<li>
|
||||||
Google for the person's name within the ietf.org site: "Jane Doe site:ietf.org". If
|
Google for the person's name within the ietf.org site: "Jane Doe site:ietf.org". If
|
||||||
found, and the email address matches an address used in drafts or discussions,
|
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,
|
things are fine, and it's OK to add the address to the allowlist using this form,
|
||||||
and ask the person to please try the
|
and ask the person to please try the
|
||||||
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a>
|
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a>
|
||||||
again.
|
again.
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
question as given above, with lowercase "wgs".
|
question as given above, with lowercase "wgs".
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If the answer to this question shows clue, then add the address to the whitelist
|
If the answer to this question shows clue, then add the address to the allowlist
|
||||||
using this form, and ask the person to please try the
|
using this form, and ask the person to please try the
|
||||||
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a>
|
<a href="{% url 'ietf.ietfauth.views.create_account' %}">account creation form</a>
|
||||||
again.
|
again.
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% bootstrap_form form %}
|
{% bootstrap_form form %}
|
||||||
<button class="btn btn-primary" type="submit">Add address to account creation whitelist</button>
|
<button class="btn btn-primary" type="submit">Add address to account creation allowlist</button>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="alert alert-info my-3">
|
<div class="alert alert-info my-3">
|
||||||
This form will link additional drafts to this session with a revision of "Current at time of presentation". For more fine grained control of versions, or to remove a draft from a session, adjust the sessions associated with a draft from the draft's main page.
|
This form will link additional drafts to this session with a revision of "Current at time of presentation". For more fine grained control of versions, or to remove a draft from a session, adjust the sessions associated with a draft from the draft's main page.
|
||||||
</div>
|
</div>
|
||||||
<h2 class="mt-5">Drafts already linked to this sesssion</h2>
|
<h2 class="mt-5">Drafts already linked to this session</h2>
|
||||||
<table class="table table-sm table-striped tablesorter">
|
<table class="table table-sm table-striped tablesorter">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load nomcom_tags person_filters %}
|
{% load nomcom_tags person_filters %}
|
||||||
{% block pagehead %}{{ formset.media.css }}{% endblock %}
|
{% block pagehead %}{{ formset.media.css }}{% endblock %}
|
||||||
{% block subtitle %}- Feeback pending{% endblock %}
|
{% block subtitle %}- Feedback pending{% endblock %}
|
||||||
{% block nomcom_content %}
|
{% block nomcom_content %}
|
||||||
{% origin %}
|
{% origin %}
|
||||||
<h2>Feedback pending from email list</h2>
|
<h2>Feedback pending from email list</h2>
|
||||||
|
|
|
@ -105,7 +105,7 @@ def _memoize(func, self, *args, **kwargs):
|
||||||
return cache[key]
|
return cache[key]
|
||||||
def memoize(func):
|
def memoize(func):
|
||||||
if not hasattr(func, '__class__'):
|
if not hasattr(func, '__class__'):
|
||||||
raise NotImplementedError("Use @lru_cache instead of memoize() for funcitons.")
|
raise NotImplementedError("Use @lru_cache instead of memoize() for functions.")
|
||||||
# For methods, we want the cache on the object, not on the class, in order
|
# For methods, we want the cache on the object, not on the class, in order
|
||||||
# to not having to think about cache bloat and content becoming stale, so
|
# to not having to think about cache bloat and content becoming stale, so
|
||||||
# we cannot set up the cache here.
|
# we cannot set up the cache here.
|
||||||
|
|
|
@ -532,13 +532,13 @@ class PlaintextDraft(Draft):
|
||||||
indent_lines.append(indent)
|
indent_lines.append(indent)
|
||||||
percents = {}
|
percents = {}
|
||||||
total = float(len(indent_lines))
|
total = float(len(indent_lines))
|
||||||
formated = False
|
formatted = False
|
||||||
for indent in set(indent_lines):
|
for indent in set(indent_lines):
|
||||||
count = indent_lines.count(indent)/total
|
count = indent_lines.count(indent)/total
|
||||||
percents[indent] = count
|
percents[indent] = count
|
||||||
if count > 0.9:
|
if count > 0.9:
|
||||||
formated = True
|
formatted = True
|
||||||
if not formated:
|
if not formatted:
|
||||||
return abstract
|
return abstract
|
||||||
new_abstract = []
|
new_abstract = []
|
||||||
for line in abstract.split('\n'):
|
for line in abstract.split('\n'):
|
||||||
|
|
|
@ -533,7 +533,7 @@ def log_smtp_exception(e):
|
||||||
def build_warning_message(request, e):
|
def build_warning_message(request, e):
|
||||||
(extype, value, tb) = exception_components(e)
|
(extype, value, tb) = exception_components(e)
|
||||||
if request:
|
if request:
|
||||||
warning = "An error occured while sending email:\n"
|
warning = "An error occurred while sending email:\n"
|
||||||
if getattr(e,'original_msg',None):
|
if getattr(e,'original_msg',None):
|
||||||
warning += "Subject: %s\n" % e.original_msg.get('Subject','[no subject]')
|
warning += "Subject: %s\n" % e.original_msg.get('Subject','[no subject]')
|
||||||
warning += "To: %s\n" % e.original_msg.get('To','[no to]')
|
warning += "To: %s\n" % e.original_msg.get('To','[no to]')
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Command(BaseCommand):
|
||||||
" $ manage.py {name} --absolute --sections=url | grep False\n"
|
" $ manage.py {name} --absolute --sections=url | grep False\n"
|
||||||
"\n".format(**locals())
|
"\n".format(**locals())
|
||||||
)
|
)
|
||||||
args = "[[master_json] latest_json]"
|
args = "[[main_json] latest_json]"
|
||||||
|
|
||||||
def create_parser(self, prog_name, subcommand):
|
def create_parser(self, prog_name, subcommand):
|
||||||
import argparse
|
import argparse
|
||||||
|
@ -78,13 +78,13 @@ class Command(BaseCommand):
|
||||||
raise CommandError("There is no data for version %s available in %s" % (version, filename))
|
raise CommandError("There is no data for version %s available in %s" % (version, filename))
|
||||||
return data[version], version
|
return data[version], version
|
||||||
|
|
||||||
def coverage_diff(self, master, latest, sections, release=None, **options):
|
def coverage_diff(self, main, latest, sections, release=None, **options):
|
||||||
master_coverage, mversion = self.read_coverage(master, release)
|
main_coverage, mversion = self.read_coverage(main, release)
|
||||||
latest_coverage, lversion = self.read_coverage(latest)
|
latest_coverage, lversion = self.read_coverage(latest)
|
||||||
self.stdout.write("\nShowing coverage differeces between %s and %s:\n" % (mversion, lversion))
|
self.stdout.write("\nShowing coverage differeces between %s and %s:\n" % (mversion, lversion))
|
||||||
for section in sections:
|
for section in sections:
|
||||||
mcoverage = master_coverage[section]["covered"]
|
mcoverage = main_coverage[section]["covered"]
|
||||||
mformat = master_coverage[section].get("format", 1)
|
mformat = main_coverage[section].get("format", 1)
|
||||||
lcoverage = latest_coverage[section]["covered"]
|
lcoverage = latest_coverage[section]["covered"]
|
||||||
lformat = latest_coverage[section].get("format", 1)
|
lformat = latest_coverage[section].get("format", 1)
|
||||||
#
|
#
|
||||||
|
@ -235,7 +235,7 @@ class Command(BaseCommand):
|
||||||
# verbosity = int(options.get('verbosity'))
|
# verbosity = int(options.get('verbosity'))
|
||||||
if not filenames:
|
if not filenames:
|
||||||
filenames = [
|
filenames = [
|
||||||
getattr(settings, 'TEST_COVERAGE_MASTER_FILE'),
|
getattr(settings, 'TEST_COVERAGE_MAIN_FILE'),
|
||||||
getattr(settings, 'TEST_COVERAGE_LATEST_FILE'),
|
getattr(settings, 'TEST_COVERAGE_LATEST_FILE'),
|
||||||
]
|
]
|
||||||
if len(filenames) != 2:
|
if len(filenames) != 2:
|
||||||
|
|
|
@ -15,7 +15,7 @@ import debug # pyflakes:ignore
|
||||||
class CoverageChangeTestCase(TestCase):
|
class CoverageChangeTestCase(TestCase):
|
||||||
|
|
||||||
def test_coverage_change(self):
|
def test_coverage_change(self):
|
||||||
master_txt ="""{
|
main_txt ="""{
|
||||||
"5.12.0": {
|
"5.12.0": {
|
||||||
"code": {
|
"code": {
|
||||||
"coverage": 0.5921474057048117,
|
"coverage": 0.5921474057048117,
|
||||||
|
@ -81,16 +81,16 @@ class CoverageChangeTestCase(TestCase):
|
||||||
"version":"latest"
|
"version":"latest"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
mfh, master = tempfile.mkstemp(suffix='.json')
|
mfh, main = tempfile.mkstemp(suffix='.json')
|
||||||
with io.open(master, "w") as file:
|
with io.open(main, "w") as file:
|
||||||
file.write(master_txt)
|
file.write(main_txt)
|
||||||
lfh, latest = tempfile.mkstemp(suffix='.json')
|
lfh, latest = tempfile.mkstemp(suffix='.json')
|
||||||
with io.open(latest, "w") as file:
|
with io.open(latest, "w") as file:
|
||||||
file.write(latest_txt)
|
file.write(latest_txt)
|
||||||
output = io.StringIO()
|
output = io.StringIO()
|
||||||
call_command('coverage_changes', master, latest, stdout=output)
|
call_command('coverage_changes', main, latest, stdout=output)
|
||||||
text = output.getvalue()
|
text = output.getvalue()
|
||||||
os.unlink(master)
|
os.unlink(main)
|
||||||
os.unlink(latest)
|
os.unlink(latest)
|
||||||
|
|
||||||
for l in [
|
for l in [
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Command(BaseCommand):
|
||||||
out = out.decode('utf-8')
|
out = out.decode('utf-8')
|
||||||
err = err.decode('utf-8')
|
err = err.decode('utf-8')
|
||||||
if code != 0:
|
if code != 0:
|
||||||
sys.stderr.write("Command '%s' retuned %s: \n%s\n%s\n" % (cmd, code, out, err))
|
sys.stderr.write("Command '%s' returned %s: \n%s\n%s\n" % (cmd, code, out, err))
|
||||||
else:
|
else:
|
||||||
c.version = (out.strip()+'\n'+err.strip()).strip()
|
c.version = (out.strip()+'\n'+err.strip()).strip()
|
||||||
if options.get('verbosity', 1) > 1:
|
if options.get('verbosity', 1) > 1:
|
||||||
|
|
|
@ -347,7 +347,7 @@ def make_test_data():
|
||||||
title="Statement regarding rights",
|
title="Statement regarding rights",
|
||||||
holder_legal_name="Native Martians United",
|
holder_legal_name="Native Martians United",
|
||||||
state=IprDisclosureStateName.objects.get(slug='posted'),
|
state=IprDisclosureStateName.objects.get(slug='posted'),
|
||||||
patent_info='Number: US12345\nTitle: A method of transfering bits\nInventor: A. Nonymous\nDate: 2000-01-01',
|
patent_info='Number: US12345\nTitle: A method of transferring bits\nInventor: A. Nonymous\nDate: 2000-01-01',
|
||||||
holder_contact_name='George',
|
holder_contact_name='George',
|
||||||
holder_contact_email='george@acme.com',
|
holder_contact_email='george@acme.com',
|
||||||
holder_contact_info='14 Main Street\nEarth',
|
holder_contact_info='14 Main Street\nEarth',
|
||||||
|
|
|
@ -733,7 +733,7 @@ class IetfTestRunner(DiscoverRunner):
|
||||||
settings.show_logging = show_logging
|
settings.show_logging = show_logging
|
||||||
#
|
#
|
||||||
self.root_dir = os.path.dirname(settings.BASE_DIR)
|
self.root_dir = os.path.dirname(settings.BASE_DIR)
|
||||||
self.coverage_file = os.path.join(self.root_dir, settings.TEST_COVERAGE_MASTER_FILE)
|
self.coverage_file = os.path.join(self.root_dir, settings.TEST_COVERAGE_MAIN_FILE)
|
||||||
super(IetfTestRunner, self).__init__(**kwargs)
|
super(IetfTestRunner, self).__init__(**kwargs)
|
||||||
if self.parallel > 1:
|
if self.parallel > 1:
|
||||||
if self.html_report == True:
|
if self.html_report == True:
|
||||||
|
|
Loading…
Reference in a new issue