From 8e6168530468a3c69e21ea13b739e08ed3dbd188 Mon Sep 17 00:00:00 2001 From: Jacob Rief Date: Mon, 11 May 2020 16:37:19 +0200 Subject: [PATCH] Remove Django<2 legacy calls --- shop/admin/customer.py | 2 +- shop/admin/defaults/commodity.py | 2 +- shop/admin/defaults/customer.py | 2 +- shop/admin/delivery.py | 2 +- shop/admin/notification.py | 2 +- shop/admin/product.py | 2 +- shop/apps.py | 2 +- shop/cascade/auth.py | 2 +- shop/cascade/breadcrumb.py | 2 +- shop/cascade/cart.py | 2 +- shop/cascade/catalog.py | 6 +++--- shop/cascade/checkout.py | 2 +- shop/cascade/extensions.py | 2 +- shop/cascade/order.py | 2 +- shop/cascade/plugin_base.py | 2 +- shop/cascade/processbar.py | 2 +- shop/cascade/search.py | 6 +++--- shop/cascade/settings.py | 2 +- shop/cms_apphooks.py | 2 +- shop/cms_menus.py | 2 +- shop/forms/auth.py | 2 +- shop/forms/base.py | 2 +- shop/forms/checkout.py | 2 +- shop/forms/wizards.py | 2 +- shop/messages.py | 6 +++--- shop/models/address.py | 2 +- shop/models/cart.py | 2 +- shop/models/customer.py | 2 +- shop/models/defaults/address.py | 2 +- shop/models/defaults/commodity.py | 2 +- shop/models/defaults/customer.py | 2 +- shop/models/defaults/delivery.py | 2 +- shop/models/defaults/delivery_item.py | 2 +- shop/models/defaults/order.py | 2 +- shop/models/defaults/order_item.py | 2 +- shop/models/delivery.py | 2 +- shop/models/fields.py | 2 +- shop/models/inventory.py | 2 +- shop/models/notification.py | 2 +- shop/models/order.py | 2 +- shop/models/product.py | 2 +- shop/models/related.py | 2 +- shop/modifiers/defaults.py | 2 +- shop/modifiers/taxes.py | 2 +- shop/money/fields.py | 2 +- shop/money/iso4217.py | 2 +- shop/payment/modifiers.py | 2 +- shop/payment/workflows.py | 2 +- shop/shipping/modifiers.py | 2 +- shop/shipping/workflows.py | 2 +- shop/views/auth.py | 6 +++--- shop/views/checkout.py | 2 +- shop/views/order.py | 2 +- 53 files changed, 61 insertions(+), 61 deletions(-) diff --git a/shop/admin/customer.py b/shop/admin/customer.py index 1214568d0..97f4ea90c 100644 --- a/shop/admin/customer.py +++ b/shop/admin/customer.py @@ -5,7 +5,7 @@ from django.contrib import admin from django.utils.encoding import force_str from django.utils.timezone import localtime -from django.utils.translation import pgettext_lazy, ugettext_lazy as _ +from django.utils.translation import pgettext_lazy, gettext_lazy as _ from shop.models.customer import CustomerModel, CustomerState diff --git a/shop/admin/defaults/commodity.py b/shop/admin/defaults/commodity.py index 4f1b78e2d..9136c3f87 100644 --- a/shop/admin/defaults/commodity.py +++ b/shop/admin/defaults/commodity.py @@ -1,6 +1,6 @@ from django.conf import settings from django.contrib import admin -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from adminsortable2.admin import SortableAdminMixin from cms.admin.placeholderadmin import PlaceholderAdminMixin, FrontendEditableAdminMixin from shop.admin.product import CMSPageAsCategoryMixin, UnitPriceMixin, CMSPageFilter diff --git a/shop/admin/defaults/customer.py b/shop/admin/defaults/customer.py index 2ddc9c003..025c7c83a 100644 --- a/shop/admin/defaults/customer.py +++ b/shop/admin/defaults/customer.py @@ -1,6 +1,6 @@ from django.contrib import admin from django.utils.html import format_html_join -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.admin.customer import CustomerProxy, CustomerInlineAdminBase, CustomerAdminBase diff --git a/shop/admin/delivery.py b/shop/admin/delivery.py index 2b0af8b5e..f000061a0 100644 --- a/shop/admin/delivery.py +++ b/shop/admin/delivery.py @@ -7,7 +7,7 @@ from django.urls import reverse from django.utils import timezone from django.utils.html import format_html -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.conf import app_settings from shop.admin.order import OrderItemInline from shop.models.order import OrderItemModel diff --git a/shop/admin/notification.py b/shop/admin/notification.py index 685e9905d..7900703c9 100644 --- a/shop/admin/notification.py +++ b/shop/admin/notification.py @@ -3,7 +3,7 @@ from django.contrib import admin from django.contrib.auth import get_user_model from django.forms import fields, models, widgets -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_fsm import RETURN_VALUE diff --git a/shop/admin/product.py b/shop/admin/product.py index f2f7292fa..6b2dc555e 100644 --- a/shop/admin/product.py +++ b/shop/admin/product.py @@ -2,7 +2,7 @@ from django.core.exceptions import ImproperlyConfigured from django.contrib import admin from django.contrib.sites.models import Site -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ try: from django_elasticsearch_dsl.registries import registry as elasticsearch_registry diff --git a/shop/apps.py b/shop/apps.py index d5f93da06..2589b69bd 100644 --- a/shop/apps.py +++ b/shop/apps.py @@ -2,7 +2,7 @@ from django.apps import AppConfig from django.core.cache import cache -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class ShopConfig(AppConfig): diff --git a/shop/cascade/auth.py b/shop/cascade/auth.py index c33ea79f6..aa3dec2db 100644 --- a/shop/cascade/auth.py +++ b/shop/cascade/auth.py @@ -1,6 +1,6 @@ from django.template.loader import select_template from django.utils.html import format_html -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.utils.module_loading import import_string from entangled.forms import EntangledModelFormMixin from cms.plugin_pool import plugin_pool diff --git a/shop/cascade/breadcrumb.py b/shop/cascade/breadcrumb.py index 7af601699..254007340 100644 --- a/shop/cascade/breadcrumb.py +++ b/shop/cascade/breadcrumb.py @@ -3,7 +3,7 @@ from django.template import engines, TemplateDoesNotExist from django.template.loader import select_template from django.utils.html import mark_safe -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from entangled.forms import EntangledModelFormMixin from cms.apphook_pool import apphook_pool from cms.plugin_pool import plugin_pool diff --git a/shop/cascade/cart.py b/shop/cascade/cart.py index 5d2487189..4ed8ecf92 100644 --- a/shop/cascade/cart.py +++ b/shop/cascade/cart.py @@ -1,7 +1,7 @@ from django.forms import fields, widgets from django.template import engines, TemplateDoesNotExist from django.template.loader import select_template, get_template -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.utils.html import mark_safe from entangled.forms import EntangledModelFormMixin from cms.plugin_pool import plugin_pool diff --git a/shop/cascade/catalog.py b/shop/cascade/catalog.py index 85aa10a47..6ed7f99c7 100644 --- a/shop/cascade/catalog.py +++ b/shop/cascade/catalog.py @@ -1,7 +1,7 @@ from django.contrib.admin import StackedInline from django.forms import fields, widgets from django.template.loader import select_template -from django.utils.translation import ugettext_lazy as _, ugettext +from django.utils.translation import gettext_lazy as _, gettext from entangled.forms import EntangledModelFormMixin, EntangledModelForm @@ -64,8 +64,8 @@ def render(self, context, instance, placeholder): def get_identifier(cls, obj): pagination = obj.glossary.get('pagination') if pagination == 'paginator': - return ugettext("Manual Pagination") - return ugettext("Infinite Scroll") + return gettext("Manual Pagination") + return gettext("Infinite Scroll") plugin_pool.register_plugin(ShopCatalogPlugin) diff --git a/shop/cascade/checkout.py b/shop/cascade/checkout.py index d2637b6d9..14139ba50 100644 --- a/shop/cascade/checkout.py +++ b/shop/cascade/checkout.py @@ -5,7 +5,7 @@ from django.utils.html import format_html from django.utils.module_loading import import_string from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _, pgettext_lazy +from django.utils.translation import gettext_lazy as _, pgettext_lazy from cms.plugin_pool import plugin_pool from djangocms_text_ckeditor.cms_plugins import TextPlugin from cmsplugin_cascade.bootstrap4.buttons import ButtonFormMixin diff --git a/shop/cascade/extensions.py b/shop/cascade/extensions.py index 7c447b963..bf0d13df6 100644 --- a/shop/cascade/extensions.py +++ b/shop/cascade/extensions.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from cms.plugin_pool import plugin_pool from cmsplugin_cascade.plugin_base import TransparentContainer from shop.cascade.plugin_base import ShopPluginBase diff --git a/shop/cascade/order.py b/shop/cascade/order.py index 5ea381f9e..4423667a4 100644 --- a/shop/cascade/order.py +++ b/shop/cascade/order.py @@ -2,7 +2,7 @@ from django.core.exceptions import ValidationError from django.template import engines from django.template.loader import select_template -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from entangled.forms import EntangledModelFormMixin from cms.plugin_pool import plugin_pool from cmsplugin_cascade.bootstrap4.buttons import BootstrapButtonMixin, ButtonFormMixin diff --git a/shop/cascade/plugin_base.py b/shop/cascade/plugin_base.py index 99393a664..d3cde3cfe 100644 --- a/shop/cascade/plugin_base.py +++ b/shop/cascade/plugin_base.py @@ -6,7 +6,7 @@ from django.template.loader import select_template from django.utils.html import format_html from django.utils.module_loading import import_string -from django.utils.translation import ugettext_lazy as _, pgettext_lazy +from django.utils.translation import gettext_lazy as _, pgettext_lazy from entangled.forms import EntangledModelFormMixin, get_related_object if 'cmsplugin_cascade' not in settings.INSTALLED_APPS: diff --git a/shop/cascade/processbar.py b/shop/cascade/processbar.py index f32ad88a8..94e9fb5dc 100644 --- a/shop/cascade/processbar.py +++ b/shop/cascade/processbar.py @@ -1,5 +1,5 @@ from django.forms import fields, widgets -from django.utils.translation import ungettext_lazy, ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.utils.text import Truncator from django.utils.html import format_html from django.forms.fields import IntegerField diff --git a/shop/cascade/search.py b/shop/cascade/search.py index 7d7bf3af3..442d4a41f 100644 --- a/shop/cascade/search.py +++ b/shop/cascade/search.py @@ -2,7 +2,7 @@ from django.forms import fields, widgets from django.template import engines from django.template.loader import select_template -from django.utils.translation import ugettext_lazy as _, ugettext +from django.utils.translation import gettext_lazy as _, gettext from entangled.forms import EntangledModelFormMixin from cms.plugin_pool import plugin_pool from shop.cascade.plugin_base import ShopPluginBase @@ -61,7 +61,7 @@ def render(self, context, instance, placeholder): def get_identifier(cls, obj): pagination = obj.glossary.get('pagination') if pagination == 'paginator': - return ugettext("Manual Pagination") - return ugettext("Infinite Scroll") + return gettext("Manual Pagination") + return gettext("Infinite Scroll") plugin_pool.register_plugin(ShopSearchResultsPlugin) diff --git a/shop/cascade/settings.py b/shop/cascade/settings.py index 0a8548a8b..54a8f2da0 100644 --- a/shop/cascade/settings.py +++ b/shop/cascade/settings.py @@ -1,5 +1,5 @@ from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from cmsplugin_cascade.bootstrap4.mixins import BootstrapUtilities diff --git a/shop/cms_apphooks.py b/shop/cms_apphooks.py index 07d9b0ab1..6f9f9c48d 100644 --- a/shop/cms_apphooks.py +++ b/shop/cms_apphooks.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from cms.app_base import CMSApp diff --git a/shop/cms_menus.py b/shop/cms_menus.py index 0d0902f84..244d00161 100644 --- a/shop/cms_menus.py +++ b/shop/cms_menus.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _, override +from django.utils.translation import gettext_lazy as _, override from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode diff --git a/shop/forms/auth.py b/shop/forms/auth.py index 5a78a0589..62ea008f3 100644 --- a/shop/forms/auth.py +++ b/shop/forms/auth.py @@ -7,7 +7,7 @@ from django.forms import widgets, ModelForm from django.template.loader import get_template, select_template, render_to_string from django.utils.html import format_html -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from djng.forms import fields, NgModelFormMixin, NgFormValidationMixin from djng.styling.bootstrap3.forms import Bootstrap3ModelForm from post_office import mail as post_office_mail diff --git a/shop/forms/base.py b/shop/forms/base.py index 5c6af16f3..fb3294e4e 100644 --- a/shop/forms/base.py +++ b/shop/forms/base.py @@ -6,7 +6,7 @@ from django.utils.encoding import force_text from django.utils.functional import cached_property from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from cms.utils.helpers import classproperty diff --git a/shop/forms/checkout.py b/shop/forms/checkout.py index c4c558a27..e528a8c25 100644 --- a/shop/forms/checkout.py +++ b/shop/forms/checkout.py @@ -1,7 +1,7 @@ from django.contrib.auth import get_user_model from django.forms import widgets, Media from django.forms.utils import ErrorDict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from djng.forms import fields from sass_processor.processor import sass_processor from shop.forms.base import DialogForm, DialogModelForm, UniqueEmailValidationMixin diff --git a/shop/forms/wizards.py b/shop/forms/wizards.py index 31818cbbf..87f4a671b 100644 --- a/shop/forms/wizards.py +++ b/shop/forms/wizards.py @@ -1,7 +1,7 @@ from django.conf import settings from django.db.models import Max from django.forms import models, fields, widgets -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from cms.wizards.forms import BaseFormMixin from djangocms_text_ckeditor.fields import HTMLFormField from shop.models.related import ProductPageModel diff --git a/shop/messages.py b/shop/messages.py index 0d5d56aa3..3c04429d1 100644 --- a/shop/messages.py +++ b/shop/messages.py @@ -4,14 +4,14 @@ import json from django.contrib import messages as django_messages -from django.utils.encoding import force_text +from django.utils.encoding import force_str def add_message(request, level, message, title=None, delay=None): if title is None: title = django_messages.DEFAULT_TAGS[level].capitalize() - extra_tags = {'title': force_text(title), 'delay': delay} - django_messages.add_message(request, level, force_text(message), extra_tags=json.dumps(extra_tags)) + extra_tags = {'title': force_str(title), 'delay': delay} + django_messages.add_message(request, level, force_str(message), extra_tags=json.dumps(extra_tags)) def success(request, message, title=None, delay=0): diff --git a/shop/models/address.py b/shop/models/address.py index 7f72cf0b4..27f91b765 100644 --- a/shop/models/address.py +++ b/shop/models/address.py @@ -3,7 +3,7 @@ """ from django.db import models from django.template.loader import select_template -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop import deferred from shop.conf import app_settings diff --git a/shop/models/cart.py b/shop/models/cart.py index 132d4c544..3a9bb4b47 100644 --- a/shop/models/cart.py +++ b/shop/models/cart.py @@ -3,7 +3,7 @@ from django.core import checks from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop import deferred from shop.models.fields import JSONField diff --git a/shop/models/customer.py b/shop/models/customer.py index 5671de38b..e2b203efb 100644 --- a/shop/models/customer.py +++ b/shop/models/customer.py @@ -12,7 +12,7 @@ from django.dispatch import receiver from django.utils import timezone from django.utils.functional import SimpleLazyObject -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop import deferred from shop.models.fields import JSONField diff --git a/shop/models/defaults/address.py b/shop/models/defaults/address.py index 45eb6bae7..3fe9d369d 100644 --- a/shop/models/defaults/address.py +++ b/shop/models/defaults/address.py @@ -1,5 +1,5 @@ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.models.address import BaseShippingAddress, BaseBillingAddress, CountryField diff --git a/shop/models/defaults/commodity.py b/shop/models/defaults/commodity.py index 6a87f5b39..592e99188 100644 --- a/shop/models/defaults/commodity.py +++ b/shop/models/defaults/commodity.py @@ -6,7 +6,7 @@ from django.conf import settings from django.core.validators import MinValueValidator from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from cms.models.fields import PlaceholderField from filer.fields import image from djangocms_text_ckeditor.fields import HTMLField diff --git a/shop/models/defaults/customer.py b/shop/models/defaults/customer.py index b931eda4f..131912c93 100644 --- a/shop/models/defaults/customer.py +++ b/shop/models/defaults/customer.py @@ -1,6 +1,6 @@ from django.db import models from django.template.loader import select_template -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.conf import app_settings from shop.models.customer import BaseCustomer diff --git a/shop/models/defaults/delivery.py b/shop/models/defaults/delivery.py index 3c00cef68..54b532b5a 100644 --- a/shop/models/defaults/delivery.py +++ b/shop/models/defaults/delivery.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.models.delivery import BaseDelivery diff --git a/shop/models/defaults/delivery_item.py b/shop/models/defaults/delivery_item.py index 5c357e13a..64ab9b7f7 100644 --- a/shop/models/defaults/delivery_item.py +++ b/shop/models/defaults/delivery_item.py @@ -1,5 +1,5 @@ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.models.delivery import BaseDeliveryItem diff --git a/shop/models/defaults/order.py b/shop/models/defaults/order.py index d06b344f0..555a7a2a6 100644 --- a/shop/models/defaults/order.py +++ b/shop/models/defaults/order.py @@ -4,7 +4,7 @@ from django.db import models from django.utils import timezone -from django.utils.translation import ugettext_lazy as _, pgettext_lazy +from django.utils.translation import gettext_lazy as _, pgettext_lazy from shop.models import order diff --git a/shop/models/defaults/order_item.py b/shop/models/defaults/order_item.py index c7ceb2cb7..bf0cdaaef 100644 --- a/shop/models/defaults/order_item.py +++ b/shop/models/defaults/order_item.py @@ -1,5 +1,5 @@ from django.db.models import PositiveIntegerField -from django.utils.translation import ugettext_lazy as _, pgettext_lazy +from django.utils.translation import gettext_lazy as _, pgettext_lazy from shop.models import order diff --git a/shop/models/delivery.py b/shop/models/delivery.py index 794b5b86e..b3b2fad11 100644 --- a/shop/models/delivery.py +++ b/shop/models/delivery.py @@ -1,6 +1,6 @@ from django.core import checks from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop import deferred from shop.models.order import BaseOrder, BaseOrderItem, OrderItemModel diff --git a/shop/models/fields.py b/shop/models/fields.py index c702c7a30..fc441aae5 100644 --- a/shop/models/fields.py +++ b/shop/models/fields.py @@ -2,7 +2,7 @@ from django.conf import settings from django.db import models from django.utils.encoding import force_text -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ postgresql_engine_names = [ diff --git a/shop/models/inventory.py b/shop/models/inventory.py index d7e7f51a9..a168d0304 100644 --- a/shop/models/inventory.py +++ b/shop/models/inventory.py @@ -2,7 +2,7 @@ from django.db import models from django.db.models.aggregates import Sum from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.conf import app_settings from shop.models.product import Availability, BaseReserveProductMixin from shop.exceptions import ProductNotAvailable diff --git a/shop/models/notification.py b/shop/models/notification.py index f557dc8a4..23b72919b 100644 --- a/shop/models/notification.py +++ b/shop/models/notification.py @@ -1,7 +1,7 @@ from django.conf import settings from django.db import models from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from post_office.models import EmailTemplate from filer.fields.file import FilerFileField from shop.conf import app_settings diff --git a/shop/models/order.py b/shop/models/order.py index bbd93bddb..55f42952b 100644 --- a/shop/models/order.py +++ b/shop/models/order.py @@ -8,7 +8,7 @@ from django.db.models.aggregates import Sum from django.urls import NoReverseMatch, reverse from django.utils.functional import cached_property -from django.utils.translation import ugettext_lazy as _, pgettext_lazy, get_language_from_request +from django.utils.translation import gettext_lazy as _, pgettext_lazy, get_language_from_request from django_fsm import FSMField, transition from ipware.ip import get_ip diff --git a/shop/models/product.py b/shop/models/product.py index 3e15424dd..7b16899b4 100644 --- a/shop/models/product.py +++ b/shop/models/product.py @@ -10,7 +10,7 @@ from django.db.models.functions import Coalesce from django.utils import timezone from django.utils.encoding import force_text -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ try: from django_elasticsearch_dsl.registries import registry as elasticsearch_registry diff --git a/shop/models/related.py b/shop/models/related.py index 1d09ada4c..0fd6b18ec 100644 --- a/shop/models/related.py +++ b/shop/models/related.py @@ -1,5 +1,5 @@ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from filer.fields import image diff --git a/shop/modifiers/defaults.py b/shop/modifiers/defaults.py index f9a9e5a56..fd12937a2 100644 --- a/shop/modifiers/defaults.py +++ b/shop/modifiers/defaults.py @@ -1,5 +1,5 @@ from decimal import Decimal -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop import messages from shop.exceptions import ProductNotAvailable from shop.money import AbstractMoney, Money diff --git a/shop/modifiers/taxes.py b/shop/modifiers/taxes.py index 31f828938..b58af47ff 100644 --- a/shop/modifiers/taxes.py +++ b/shop/modifiers/taxes.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.conf import app_settings from shop.serializers.cart import ExtraCartRow diff --git a/shop/money/fields.py b/shop/money/fields.py index 39f1d325c..5a18f2ed2 100644 --- a/shop/money/fields.py +++ b/shop/money/fields.py @@ -4,7 +4,7 @@ from django import forms from django.db import models from django.utils.html import format_html -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.conf import app_settings from shop.money.iso4217 import CURRENCIES diff --git a/shop/money/iso4217.py b/shop/money/iso4217.py index ac581c959..5df4e4757 100644 --- a/shop/money/iso4217.py +++ b/shop/money/iso4217.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ # Dictionary of currency representations: # key: official ISO 4217 code diff --git a/shop/payment/modifiers.py b/shop/payment/modifiers.py index f8c331755..6525e4225 100644 --- a/shop/payment/modifiers.py +++ b/shop/payment/modifiers.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.modifiers.base import BaseCartModifier from shop.payment.providers import PaymentProvider, ForwardFundPayment diff --git a/shop/payment/workflows.py b/shop/payment/workflows.py index caa128f21..bd7e56611 100644 --- a/shop/payment/workflows.py +++ b/shop/payment/workflows.py @@ -1,5 +1,5 @@ from django.core.exceptions import ImproperlyConfigured -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_fsm import transition, RETURN_VALUE from shop.models.order import BaseOrder diff --git a/shop/shipping/modifiers.py b/shop/shipping/modifiers.py index 8df4377ab..aea71529d 100644 --- a/shop/shipping/modifiers.py +++ b/shop/shipping/modifiers.py @@ -1,5 +1,5 @@ from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shop.modifiers.base import BaseCartModifier diff --git a/shop/shipping/workflows.py b/shop/shipping/workflows.py index 09cf6cfad..21ee7b94b 100644 --- a/shop/shipping/workflows.py +++ b/shop/shipping/workflows.py @@ -1,7 +1,7 @@ from django.db.models import Sum from django.utils import timezone from django.utils.functional import cached_property -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_fsm import transition from shop.models.delivery import DeliveryModel, DeliveryItemModel diff --git a/shop/views/auth.py b/shop/views/auth.py index 3d3c54d0c..a5da87af0 100644 --- a/shop/views/auth.py +++ b/shop/views/auth.py @@ -2,8 +2,8 @@ from django.contrib.auth.models import AnonymousUser from django.contrib.auth.tokens import default_token_generator from django.core.exceptions import NON_FIELD_ERRORS -from django.utils.encoding import force_text -from django.utils.translation import ugettext_lazy as _ +from django.utils.encoding import force_str +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.views import APIView @@ -179,7 +179,7 @@ def get(self, request, uidb64=None, token=None): return Response({'validlink': False}) return Response({ 'validlink': True, - 'user_name': force_text(serializer.user), + 'user_name': force_str(serializer.user), 'form_name': 'password_reset_form', }) diff --git a/shop/views/checkout.py b/shop/views/checkout.py index 46cec149e..30122de38 100644 --- a/shop/views/checkout.py +++ b/shop/views/checkout.py @@ -1,7 +1,7 @@ from django.core.exceptions import ImproperlyConfigured from django.db import transaction from django.utils.module_loading import import_string -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.exceptions import ValidationError diff --git a/shop/views/order.py b/shop/views/order.py index 08948bb7c..ad5b81fcb 100644 --- a/shop/views/order.py +++ b/shop/views/order.py @@ -1,6 +1,6 @@ from django.utils import timezone from django.views.decorators.cache import never_cache -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import generics, mixins from rest_framework.exceptions import NotFound, MethodNotAllowed from rest_framework.pagination import LimitOffsetPagination