Changed some # type: ignore statements to work with the latest mypy
- Legacy-Id: 16968
This commit is contained in:
parent
c565dca35b
commit
b7724c43d7
|
@ -11,7 +11,7 @@ from docutils.utils import SystemMessage
|
|||
import debug # pyflakes:ignore
|
||||
|
||||
from django.template.loaders.base import Loader as BaseLoader
|
||||
from django.template.base import Template as DjangoTemplate, TemplateEncodingError # type: ignore (FIXME: remove when Django 2)
|
||||
from django.template.base import Template as DjangoTemplate, TemplateEncodingError # type: ignore
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
from django.utils.encoding import smart_text
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ from django.urls import reverse as urlreverse
|
|||
from django.db.models import Q
|
||||
from django.http import Http404, HttpResponseBadRequest, HttpResponse, HttpResponseRedirect, QueryDict
|
||||
from django.shortcuts import render
|
||||
from django.utils.cache import _generate_cache_key # type: ignore (FIXME: remove when Django 2)
|
||||
from django.utils.cache import _generate_cache_key # type: ignore
|
||||
|
||||
|
||||
import debug # pyflakes:ignore
|
||||
|
|
|
@ -41,7 +41,7 @@ class Migration(migrations.Migration):
|
|||
('about_page', models.CharField(default='ietf.group.views.group_about', max_length=64)),
|
||||
('default_tab', models.CharField(default='ietf.group.views.group_about', max_length=64)),
|
||||
('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_-]+)*')])),
|
||||
# type: ignore (FIXME: remove when Django 2)
|
||||
# type: ignore
|
||||
('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_-]+)*')])),
|
||||
('agenda_type', models.ForeignKey(default='ietf', null=True, on_delete=django.db.models.deletion.CASCADE, to='name.AgendaTypeName')),
|
||||
],
|
||||
|
|
|
@ -45,7 +45,7 @@ class Migration(migrations.Migration):
|
|||
model_name='groupfeatures',
|
||||
name='role_order',
|
||||
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_-]+)*')]),
|
||||
# type: ignore (FIXME: remove when Django 2)
|
||||
# type: ignore
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='groupfeatures',
|
||||
|
@ -61,7 +61,7 @@ class Migration(migrations.Migration):
|
|||
model_name='groupfeatures',
|
||||
name='matman_roles',
|
||||
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_-]+)*')]),
|
||||
# type: ignore (FIXME: remove when Django 2)
|
||||
# type: ignore
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='historicalgroupfeatures',
|
||||
|
@ -92,7 +92,7 @@ class Migration(migrations.Migration):
|
|||
model_name='historicalgroupfeatures',
|
||||
name='role_order',
|
||||
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_-]+)*')]),
|
||||
# type: ignore (FIXME: remove when Django 2)
|
||||
# type: ignore
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='historicalgroupfeatures',
|
||||
|
@ -108,6 +108,6 @@ class Migration(migrations.Migration):
|
|||
model_name='historicalgroupfeatures',
|
||||
name='matman_roles',
|
||||
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_-]+)*')]),
|
||||
# type: ignore (FIXME: remove when Django 2)
|
||||
# type: ignore
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright The IETF Trust 2007-2019, All Rights Reserved
|
||||
# Copyright The IETF Trust 2007, 2009, All Rights Reserved
|
||||
|
||||
from django.contrib.auth.views import logout # type: ignore (FIXME: remove when Django 2)
|
||||
from django.contrib.auth.views import logout # type: ignore
|
||||
|
||||
from ietf.ietfauth import views
|
||||
from ietf.utils.urls import url
|
||||
|
|
|
@ -8,4 +8,4 @@ from ietf.ipr.models import IprDisclosureBase
|
|||
|
||||
queryset = IprDisclosureBase.objects.filter(state__in=('posted','removed'))
|
||||
archive = {'queryset':queryset, 'date_field': 'time', 'allow_empty':True }
|
||||
IPRMap = GenericSitemap(archive) # type: ignore (FIXME: remove when Django 2)
|
||||
IPRMap = GenericSitemap(archive) # type: ignore
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#import logging
|
||||
|
||||
from django.db import connection
|
||||
from django.utils.log import getLogger # type: ignore (FIXME: remove when Django 2)
|
||||
from django.utils.log import getLogger # type: ignore
|
||||
|
||||
|
||||
logger = getLogger(__name__)
|
||||
|
|
|
@ -291,11 +291,11 @@ def submission_status(request, submission_id, access_token=None):
|
|||
prev_authors = [] if not doc else [ author.person for author in doc.documentauthor_set.all() ]
|
||||
curr_authors = [ get_person_from_name_email(author["name"], author.get("email")) for author in submission.authors ]
|
||||
|
||||
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" )
|
||||
if request.user.is_authenticated and request.user.person in (prev_authors if submission.rev != '00' else curr_authors): # type: ignore
|
||||
# go directly to posting submission
|
||||
docevent_from_submission(request, submission, desc="Uploaded new revision", who=request.user.person) # type: ignore (FIXME: revisit: "User" has no attribute "person" )
|
||||
docevent_from_submission(request, submission, desc="Uploaded new revision", who=request.user.person) # type: ignore
|
||||
|
||||
desc = "New version accepted (logged-in submitter: %s)" % request.user.person # type: ignore (FIXME: revisit: "User" has no attribute "person")
|
||||
desc = "New version accepted (logged-in submitter: %s)" % request.user.person # type: ignore
|
||||
post_submission(request, submission, desc)
|
||||
create_submission_event(request, submission, desc)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue