Skip to content

Commit

Permalink
Update import paths and fix deprecated modules for Django 3 (#9983)
Browse files Browse the repository at this point in the history
Co-authored-by: John Tordoff <>
  • Loading branch information
Johnetordoff authored and cslzchen committed Oct 20, 2022
1 parent 2868f15 commit 88f1345
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion admin/brands/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion admin/internet_archive/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion admin/management/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion admin/nodes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion admin/preprints/views.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion admin/registration_schemas/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion api/base/pagination.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/base/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion api/base/versioning.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/files/annotations.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/files/serializers.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/json_api_test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 88f1345

Please sign in to comment.