diff --git a/admin/brands/views.py b/admin/brands/views.py index ff093c447ea..3fc6a25ce6b 100644 --- a/admin/brands/views.py +++ b/admin/brands/views.py @@ -6,7 +6,7 @@ CreateView, UpdateView, ) -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.forms.models import model_to_dict from django.contrib import messages diff --git a/admin/internet_archive/views.py b/admin/internet_archive/views.py index e5a9fdaf9bd..254718726f5 100644 --- a/admin/internet_archive/views.py +++ b/admin/internet_archive/views.py @@ -13,7 +13,7 @@ from osf.management.commands.sync_ia_metadata import ( sync_ia_metadata, ) -from django.core.urlresolvers import reverse +from django.urls import reverse from django.shortcuts import redirect from admin.base.forms import ArchiveRegistrationWithPigeonForm from website import settings diff --git a/admin/management/views.py b/admin/management/views.py index 97165f6b0bd..bf0d54f3c1f 100644 --- a/admin/management/views.py +++ b/admin/management/views.py @@ -8,7 +8,7 @@ from osf.management.commands.update_registration_schemas import update_registration_schemas from osf.management.commands.daily_reporters_go import daily_reporters_go from scripts.find_spammy_content import manage_spammy_content -from django.core.urlresolvers import reverse +from django.urls import reverse from django.shortcuts import redirect from osf.models import Preprint, Node, Registration diff --git a/admin/nodes/views.py b/admin/nodes/views.py index 73a210bb97b..4254e4fabea 100644 --- a/admin/nodes/views.py +++ b/admin/nodes/views.py @@ -4,7 +4,7 @@ from django.utils import timezone from django.core.exceptions import PermissionDenied, ValidationError -from django.core.urlresolvers import NoReverseMatch +from django.urls import NoReverseMatch from django.db.models import F, Case, When, IntegerField from django.contrib import messages from django.contrib.auth.mixins import PermissionRequiredMixin diff --git a/admin/preprints/views.py b/admin/preprints/views.py index 7b25cd10359..0b8eca12825 100644 --- a/admin/preprints/views.py +++ b/admin/preprints/views.py @@ -1,6 +1,6 @@ from django.db.models import F from django.core.exceptions import PermissionDenied -from django.core.urlresolvers import NoReverseMatch +from django.urls import NoReverseMatch from django.contrib import messages from django.contrib.auth.mixins import PermissionRequiredMixin from django.shortcuts import redirect diff --git a/admin/registration_schemas/views.py b/admin/registration_schemas/views.py index 4070a9109ae..aa205839029 100644 --- a/admin/registration_schemas/views.py +++ b/admin/registration_schemas/views.py @@ -5,7 +5,7 @@ from django.views.generic import ListView, TemplateView, FormView, DeleteView from admin.registration_schemas.forms import RegistrationSchemaCreateForm, RegistrationSchemaEditForm from django.contrib import messages -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.db.models import Max from django.http import HttpResponseRedirect diff --git a/api/base/pagination.py b/api/base/pagination.py index 920f4e39e5c..a2ea6612dae 100644 --- a/api/base/pagination.py +++ b/api/base/pagination.py @@ -1,4 +1,4 @@ -from django.utils import six +import six from collections import OrderedDict from django.urls import reverse from django.core.paginator import InvalidPage, Paginator as DjangoPaginator diff --git a/api/base/serializers.py b/api/base/serializers.py index 66026da5f26..658c1f71997 100644 --- a/api/base/serializers.py +++ b/api/base/serializers.py @@ -4,7 +4,7 @@ import furl import waffle -from django.core.urlresolvers import resolve, reverse, NoReverseMatch +from django.urls import resolve, reverse, NoReverseMatch from django.core.exceptions import ImproperlyConfigured from distutils.version import StrictVersion diff --git a/api/base/versioning.py b/api/base/versioning.py index b56b614bab1..7ca74cc82d1 100644 --- a/api/base/versioning.py +++ b/api/base/versioning.py @@ -1,4 +1,4 @@ -from django.core.urlresolvers import NoReverseMatch +from django.urls import NoReverseMatch from rest_framework import exceptions as drf_exceptions from rest_framework import versioning as drf_versioning from rest_framework.compat import unicode_http_header diff --git a/api/files/annotations.py b/api/files/annotations.py index 53b38bcf069..a4a107438d6 100644 --- a/api/files/annotations.py +++ b/api/files/annotations.py @@ -1,5 +1,5 @@ from django.db.models import BooleanField, Case, Exists, F, IntegerField, Max, OuterRef, Q, Subquery, Value, When -from django.db.models.functions.base import Cast +from django.db.models.functions import Cast from django.contrib.postgres.fields.jsonb import KeyTextTransform from osf.utils.datetime_aware_jsonfield import DateTimeAwareJSONField from osf.utils.fields import NonNaiveDateTimeField diff --git a/api/files/serializers.py b/api/files/serializers.py index c007a37d9f1..c66ea12d0ce 100644 --- a/api/files/serializers.py +++ b/api/files/serializers.py @@ -1,7 +1,7 @@ from datetime import datetime from collections import OrderedDict -from django.core.urlresolvers import resolve, reverse +from django.urls import resolve, reverse from django.core.exceptions import ValidationError import furl diff --git a/tests/json_api_test_app.py b/tests/json_api_test_app.py index b78e6b376d8..2702c83b7a8 100644 --- a/tests/json_api_test_app.py +++ b/tests/json_api_test_app.py @@ -4,7 +4,7 @@ from django.test.signals import template_rendered from django.core import signals from django.test.client import store_rendered_templates -from django.utils.functional import curry +from functools import partial try: from django.db import close_old_connections except ImportError: @@ -82,7 +82,7 @@ def do_request(self, req, status, expect_errors): # Curry a data dictionary into an instance of the template renderer # callback function. data = {} - on_template_render = curry(store_rendered_templates, data) + on_template_render = partial(store_rendered_templates, data) template_rendered.connect(on_template_render) response = super(JSONAPITestApp, self).do_request(req, status,