Skip to content

Commit

Permalink
Fix final deprecations.
Browse files Browse the repository at this point in the history
  • Loading branch information
amanning9 committed May 5, 2023
1 parent 9e58bff commit e1d0e29
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions jasmin_services/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from datetime import date

import django.contrib.auth
import django.utils.encoding
from dateutil.relativedelta import relativedelta
from django import forms
from django.conf import settings
from django.contrib.admin.widgets import AdminDateWidget, FilteredSelectMultiple
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from markdown_deux.templatetags.markdown_deux_tags import markdown_allowed

Expand Down Expand Up @@ -373,7 +373,7 @@ def __init__(self, switch_field_name, model_map, attrs=None):
def render(self, name, value, attrs=None, renderer=None):
if attrs is None:
attrs = {}
value = force_text(value) if value else ""
value = django.utils.encoding.force_str(value) if value else ""
attrs["class"] = "vForeignKeyRawIdAdminField"
attrs["style"] = "width: 20em !important;"
# Translate the model_map into an href_map
Expand Down
4 changes: 2 additions & 2 deletions jasmin_services/views/service_list.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import logging
import urllib.parse

from django import http
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db.models import Exists, OuterRef, Q
from django.shortcuts import render
from django.utils.http import urlquote
from django.views.decorators.http import require_safe

from ..models import Category, Grant, Request
Expand Down Expand Up @@ -142,7 +142,7 @@ def service_list(request, category):
for service in page
],
"page": page,
"preserved_filters": "query={}".format(urlquote(request.GET["query"]))
"preserved_filters": "query={}".format(urllib.parse.quote(request.GET["query"]))
if "query" in request.GET
else "",
},
Expand Down
6 changes: 3 additions & 3 deletions jasmin_services/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import json

import django.urls
import django.utils.encoding
from django import forms
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from django.urls import reverse
from django.urls.exceptions import NoReverseMatch
from django.utils.encoding import force_text


#####
Expand All @@ -36,7 +36,7 @@ def generic_object_text(request):
except ObjectDoesNotExist:
content = "Object does not exist."
else:
content = force_text(obj)
content = django.utils.encoding.force_str(obj)
return HttpResponse(content=content, content_type="text/plain")


Expand Down Expand Up @@ -101,7 +101,7 @@ def build_attrs(self, *args, **kwargs):
ctype_url_map = {}
for ctype in ContentType.objects.all():
try:
ctype_url_map[force_text(ctype.pk)] = reverse(
ctype_url_map[django.utils.encoding.force_str(ctype.pk)] = reverse(
"admin:{}_{}_changelist".format(ctype.app_label, ctype.model),
current_app=self.admin_site.name,
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python = "^3.9"

# Dependencies of dependencies. Need to specify here so poetry knows where to get them from.
jasmin-ldap = {git = "https://github.com/cedadev/jasmin-ldap.git", tag = "v1.0.0"}
jasmin-django-utils = {git = "https://github.com/cedadev/jasmin-django-utils.git", tag = "v1.0.7" }# Also required for API.
jasmin-django-utils = {git = "https://github.com/cedadev/jasmin-django-utils.git", tag = "v1.0.8" }# Also required for API.

Django = ">=3.2,!=4.0,!=4.1,<4.3"
django-bootstrap5 = "^23.1"
Expand Down

0 comments on commit e1d0e29

Please sign in to comment.