Skip to content

Commit

Permalink
Remove Django<2 legacy calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed May 11, 2020
1 parent bcf8a41 commit 8e61685
Show file tree
Hide file tree
Showing 53 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion shop/admin/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion shop/admin/defaults/commodity.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/admin/defaults/customer.py
Original file line number Diff line number Diff line change
@@ -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


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

Expand Down
2 changes: 1 addition & 1 deletion shop/admin/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/auth.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/breadcrumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/cart.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions shop/cascade/catalog.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/extensions.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/plugin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion shop/cascade/processbar.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions shop/cascade/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion shop/cascade/settings.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
2 changes: 1 addition & 1 deletion shop/cms_apphooks.py
Original file line number Diff line number Diff line change
@@ -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

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

Expand Down
2 changes: 1 addition & 1 deletion shop/forms/checkout.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/forms/wizards.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions shop/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion shop/models/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/defaults/address.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion shop/models/defaults/commodity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/defaults/customer.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion shop/models/defaults/delivery.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
2 changes: 1 addition & 1 deletion shop/models/defaults/delivery_item.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
2 changes: 1 addition & 1 deletion shop/models/defaults/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion shop/models/defaults/order_item.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
2 changes: 1 addition & 1 deletion shop/models/delivery.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion shop/models/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/notification.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/models/related.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion shop/modifiers/defaults.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shop/modifiers/taxes.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 8e61685

Please sign in to comment.