Skip to content

Commit b7724c4

Browse files
committed
Changed some # type: ignore statements to work with the latest mypy
- Legacy-Id: 16968
1 parent c565dca commit b7724c4

8 files changed

Lines changed: 13 additions & 13 deletions

File tree

ietf/dbtemplate/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import debug # pyflakes:ignore
1212

1313
from django.template.loaders.base import Loader as BaseLoader
14-
from django.template.base import Template as DjangoTemplate, TemplateEncodingError # type: ignore (FIXME: remove when Django 2)
14+
from django.template.base import Template as DjangoTemplate, TemplateEncodingError # type: ignore
1515
from django.template.exceptions import TemplateDoesNotExist
1616
from django.utils.encoding import smart_text
1717

ietf/doc/views_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
from django.db.models import Q
4747
from django.http import Http404, HttpResponseBadRequest, HttpResponse, HttpResponseRedirect, QueryDict
4848
from django.shortcuts import render
49-
from django.utils.cache import _generate_cache_key # type: ignore (FIXME: remove when Django 2)
49+
from django.utils.cache import _generate_cache_key # type: ignore
5050

5151

5252
import debug # pyflakes:ignore

ietf/group/migrations/0002_groupfeatures_historicalgroupfeatures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Migration(migrations.Migration):
4141
('about_page', models.CharField(default='ietf.group.views.group_about', max_length=64)),
4242
('default_tab', models.CharField(default='ietf.group.views.group_about', max_length=64)),
4343
('material_types', models.CharField(default='slides', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of material types', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')])),
44-
# type: ignore (FIXME: remove when Django 2)
44+
# type: ignore
4545
('admin_roles', models.CharField(default='chair', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of role slugs', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')])),
4646
('agenda_type', models.ForeignKey(default='ietf', null=True, on_delete=django.db.models.deletion.CASCADE, to='name.AgendaTypeName')),
4747
],

ietf/group/migrations/0004_add_group_feature_fields.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Migration(migrations.Migration):
4545
model_name='groupfeatures',
4646
name='role_order',
4747
field=models.CharField(default='chair,secr,member', help_text='The order in which roles are shown, for instance on photo pages', max_length=128, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of role slugs', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')]),
48-
# type: ignore (FIXME: remove when Django 2)
48+
# type: ignore
4949
),
5050
migrations.AddField(
5151
model_name='groupfeatures',
@@ -61,7 +61,7 @@ class Migration(migrations.Migration):
6161
model_name='groupfeatures',
6262
name='matman_roles',
6363
field=models.CharField(default='ad,chair,delegate,secr', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of role slugs', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')]),
64-
# type: ignore (FIXME: remove when Django 2)
64+
# type: ignore
6565
),
6666
migrations.AddField(
6767
model_name='historicalgroupfeatures',
@@ -92,7 +92,7 @@ class Migration(migrations.Migration):
9292
model_name='historicalgroupfeatures',
9393
name='role_order',
9494
field=models.CharField(default='chair,secr,member', help_text='The order in which roles are shown, for instance on photo pages', max_length=128, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of role slugs', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')]),
95-
# type: ignore (FIXME: remove when Django 2)
95+
# type: ignore
9696
),
9797
migrations.AddField(
9898
model_name='historicalgroupfeatures',
@@ -108,6 +108,6 @@ class Migration(migrations.Migration):
108108
model_name='historicalgroupfeatures',
109109
name='matman_roles',
110110
field=models.CharField(default='ad,chair,delegate,secr', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of role slugs', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')]),
111-
# type: ignore (FIXME: remove when Django 2)
111+
# type: ignore
112112
),
113113
]

ietf/ietfauth/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright The IETF Trust 2007-2019, All Rights Reserved
22
# Copyright The IETF Trust 2007, 2009, All Rights Reserved
33

4-
from django.contrib.auth.views import logout # type: ignore (FIXME: remove when Django 2)
4+
from django.contrib.auth.views import logout # type: ignore
55

66
from ietf.ietfauth import views
77
from ietf.utils.urls import url

ietf/ipr/sitemaps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
queryset = IprDisclosureBase.objects.filter(state__in=('posted','removed'))
1010
archive = {'queryset':queryset, 'date_field': 'time', 'allow_empty':True }
11-
IPRMap = GenericSitemap(archive) # type: ignore (FIXME: remove when Django 2)
11+
IPRMap = GenericSitemap(archive) # type: ignore

ietf/secr/middleware/dbquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#import logging
33

44
from django.db import connection
5-
from django.utils.log import getLogger # type: ignore (FIXME: remove when Django 2)
5+
from django.utils.log import getLogger # type: ignore
66

77

88
logger = getLogger(__name__)

ietf/submit/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ def submission_status(request, submission_id, access_token=None):
291291
prev_authors = [] if not doc else [ author.person for author in doc.documentauthor_set.all() ]
292292
curr_authors = [ get_person_from_name_email(author["name"], author.get("email")) for author in submission.authors ]
293293

294-
if request.user.is_authenticated and request.user.person in (prev_authors if submission.rev != '00' else curr_authors): # type: ignore (FIXME: revisit: "User" has no attribute "person" )
294+
if request.user.is_authenticated and request.user.person in (prev_authors if submission.rev != '00' else curr_authors): # type: ignore
295295
# go directly to posting submission
296-
docevent_from_submission(request, submission, desc="Uploaded new revision", who=request.user.person) # type: ignore (FIXME: revisit: "User" has no attribute "person" )
296+
docevent_from_submission(request, submission, desc="Uploaded new revision", who=request.user.person) # type: ignore
297297

298-
desc = "New version accepted (logged-in submitter: %s)" % request.user.person # type: ignore (FIXME: revisit: "User" has no attribute "person")
298+
desc = "New version accepted (logged-in submitter: %s)" % request.user.person # type: ignore
299299
post_submission(request, submission, desc)
300300
create_submission_event(request, submission, desc)
301301
else:

0 commit comments

Comments
 (0)