Skip to content

Commit f41fd18

Browse files
committed
Upgraded the required versions of mypy and django-stubs to the latest that support Django 2.2. Fixed some issues found by after the upgrades.
- Legacy-Id: 18717
1 parent b5f1e3a commit f41fd18

8 files changed

Lines changed: 12 additions & 11 deletions

File tree

ietf/ietfauth/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def clean(self):
246246

247247

248248
class ChangeUsernameForm(forms.Form):
249-
username = forms.ChoiceField(choices=['-','--------'])
249+
username = forms.ChoiceField(choices=[('-','--------')])
250250
password = forms.CharField(widget=forms.PasswordInput, help_text="Confirm the change with your password")
251251

252252
def __init__(self, user, *args, **kwargs):

ietf/ietfauth/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
from django.contrib.auth.models import User
5151
from django.contrib.auth.views import LoginView
5252
from django.contrib.sites.models import Site
53-
from django.core.exceptions import ObjectDoesNotExist
54-
from django.core.validators import ValidationError
53+
from django.core.exceptions import ObjectDoesNotExist, ValidationError
5554
from django.urls import reverse as urlreverse
5655
from django.utils.safestring import mark_safe
5756
from django.http import Http404, HttpResponseRedirect #, HttpResponse,

ietf/liaisons/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
from django import forms
1515
from django.conf import settings
16-
from django.core.exceptions import ObjectDoesNotExist
16+
from django.core.exceptions import ObjectDoesNotExist, ValidationError
1717
from django.db.models.query import QuerySet
1818
from django.forms.utils import ErrorList
1919
from django.db.models import Q
2020
#from django.forms.widgets import RadioFieldRenderer
21-
from django.core.validators import validate_email, ValidationError
21+
from django.core.validators import validate_email
2222

2323
import debug # pyflakes:ignore
2424

ietf/liaisons/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
from django.contrib import messages
99
from django.urls import reverse as urlreverse
10-
from django.core.validators import validate_email, ValidationError
10+
from django.core.exceptions import ValidationError
11+
from django.core.validators import validate_email
1112
from django.db.models import Q, Prefetch
1213
from django.http import HttpResponse
1314
from django.shortcuts import render, get_object_or_404, redirect

ietf/submit/mail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from django.conf import settings
1313
from django.urls import reverse as urlreverse
14-
from django.core.validators import ValidationError
14+
from django.core.exceptions import ValidationError
1515
from django.contrib.sites.models import Site
1616
from django.template.loader import render_to_string
1717
from django.utils.encoding import force_text, force_str

ietf/submit/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
from typing import Callable, Optional # pyflakes:ignore
1313

1414
from django.conf import settings
15-
from django.core.validators import validate_email, ValidationError
15+
from django.core.exceptions import ValidationError
16+
from django.core.validators import validate_email
1617
from django.db import transaction
1718
from django.http import HttpRequest # pyflakes:ignore
1819
from django.utils.module_loading import import_string

ietf/submit/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from django.contrib.auth.models import User
1414
from django.db import DataError
1515
from django.urls import reverse as urlreverse
16-
from django.core.validators import ValidationError
16+
from django.core.exceptions import ValidationError
1717
from django.http import HttpResponseRedirect, Http404, HttpResponseForbidden, HttpResponse
1818
from django.http import HttpRequest # pyflakes:ignore
1919
from django.shortcuts import get_object_or_404, redirect, render

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ django-oidc-provider>=0.7
2020
django-password-strength>=1.2.1
2121
django-referrer-policy>=1.0
2222
django-simple-history>=2.3.0
23-
django-stubs==1.3.0 # The django-stubs version used determines the the mypy version indicated below
23+
django-stubs==1.6.0 # The django-stubs version used determines the the mypy version indicated below
2424
django-tastypie>=0.14.3 # Django 2.1 will require 0.14.2; Django 3.0 will require 0.14.3
2525
django-webtest>=1.9.7
2626
django-widget-tweaks>=1.4.2
@@ -38,7 +38,7 @@ logging_tree>=1.8.1
3838
lxml>=3.4.0,<5
3939
markdown2>=2.3.8
4040
mock>=2.0.0
41-
mypy==0.750 # Version requirements determined by django-stubs.
41+
mypy>=0.782,<0.790 # Version requirements determined by django-stubs.
4242
mysqlclient>=1.3.13
4343
oic>=1.2
4444
pathlib>=1.0

0 commit comments

Comments
 (0)