From bcf40dab2035b0869a5e2a92b0a22693641c9beb Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Mon, 18 Nov 2019 14:23:30 +0100 Subject: [PATCH] Replace force_text with force_str, force_text removed in Django 3. --- opentech/apply/stream_forms/blocks.py | 4 ++-- opentech/apply/users/views.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opentech/apply/stream_forms/blocks.py b/opentech/apply/stream_forms/blocks.py index d8a808422..09b37619c 100644 --- a/opentech/apply/stream_forms/blocks.py +++ b/opentech/apply/stream_forms/blocks.py @@ -9,7 +9,7 @@ from django.core.validators import FileExtensionValidator from django.db.models import BLANK_CHOICE_DASH from django.forms.widgets import ClearableFileInput from django.utils.dateparse import parse_datetime -from django.utils.encoding import force_text +from django.utils.encoding import force_str from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ from unidecode import unidecode @@ -33,7 +33,7 @@ class FormFieldBlock(StructBlock): template = 'stream_forms/render_field.html' def get_slug(self, struct_value): - return force_text(slugify(unidecode(struct_value['field_label']))) + return force_str(slugify(unidecode(struct_value['field_label']))) def get_field_class(self, struct_value): return self.field_class diff --git a/opentech/apply/users/views.py b/opentech/apply/users/views.py index 880143828..91cc11024 100644 --- a/opentech/apply/users/views.py +++ b/opentech/apply/users/views.py @@ -11,7 +11,7 @@ from django.shortcuts import redirect, render, resolve_url from django.template.response import TemplateResponse from django.urls import reverse_lazy from django.utils.decorators import method_decorator -from django.utils.encoding import force_text +from django.utils.encoding import force_str from django.utils.http import is_safe_url, urlsafe_base64_decode from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_protect @@ -149,7 +149,7 @@ class ActivationView(TemplateView): """ try: user = User.objects.get(**{ - 'pk': force_text(urlsafe_base64_decode(uidb64)) + 'pk': force_str(urlsafe_base64_decode(uidb64)) }) return user except (TypeError, ValueError, OverflowError, User.DoesNotExist): -- GitLab