Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove gettext occurrences from account

IKarbowiak9ce10d4e03c5
diff --git a/saleor/account/__init__.py b/saleor/account/__init__.py
index 8524800b49..7fd6332fb1 100755
--- a/saleor/account/__init__.py
+++ b/saleor/account/__init__.py
@@ -1,6 +1,3 @@
-from django.utils.translation import pgettext_lazy
-
-
class CustomerEvents:
"""The different customer event types."""
@@ -24,94 +21,20 @@ class CustomerEvents:
NOTE_ADDED = "note_added" # the staff user added a note to the customer
CHOICES = [
- (
- ACCOUNT_CREATED,
- pgettext_lazy(
- "Event from a customer that got their account created",
- "The account was created",
- ),
- ),
- (
- PASSWORD_RESET_LINK_SENT,
- pgettext_lazy(
- "Event from a customer that got the password reset link sent by email",
- "Password reset link was sent to the customer",
- ),
- ),
- (
- PASSWORD_RESET,
- pgettext_lazy(
- "Event from a customer that reset their password",
- "The account password was reset",
- ),
- ),
+ (ACCOUNT_CREATED, "The account was created"),
+ (PASSWORD_RESET_LINK_SENT, "Password reset link was sent to the customer"),
+ (PASSWORD_RESET, "The account password was reset"),
(
EMAIL_CHANGE_REQUEST,
- pgettext_lazy(
- "Event from a customer that requested email address change",
- "The user requested to change the account's email address.",
- ),
- ),
- (
- PASSWORD_CHANGED,
- pgettext_lazy(
- "Event from a customer that changed their password",
- "The account password was changed",
- ),
- ),
- (
- EMAIL_CHANGED,
- pgettext_lazy(
- "Event from a customer that changed their email address",
- "The account email address was changed",
- ),
- ),
- (
- PLACED_ORDER,
- pgettext_lazy(
- "Event from a customer that placed an order", "An order was placed"
- ),
- ),
- (
- NOTE_ADDED_TO_ORDER,
- pgettext_lazy(
- "Event from a customer that added a note to one of their orders",
- "A note was added",
- ),
- ),
- (
- DIGITAL_LINK_DOWNLOADED,
- pgettext_lazy(
- "Event from a customer that downloaded an ordered digital good",
- "A digital good was downloaded",
- ),
- ),
- (
- CUSTOMER_DELETED,
- pgettext_lazy(
- "Event from a staff user that deleted a customer",
- "A customer was deleted",
- ),
- ),
- (
- NAME_ASSIGNED,
- pgettext_lazy(
- "Event from a staff user assigned a new name to a customer",
- "A customer's name was edited",
- ),
- ),
- (
- EMAIL_ASSIGNED,
- pgettext_lazy(
- "Event from a staff user assigned a new email address to a customer",
- "A customer's email address was edited",
- ),
- ),
- (
- NOTE_ADDED,
- pgettext_lazy(
- "Event from a staff user assigned a new email address to a customer",
- "A note was added to the customer",
- ),
- ),
+ "The user requested to change the account's email address.",
+ ),
+ (PASSWORD_CHANGED, "The account password was changed"),
+ (EMAIL_CHANGED, "The account email address was changed"),
+ (PLACED_ORDER, "An order was placed"),
+ (NOTE_ADDED_TO_ORDER, "A note was added"),
+ (DIGITAL_LINK_DOWNLOADED, "A digital good was downloaded"),
+ (CUSTOMER_DELETED, "A customer was deleted"),
+ (NAME_ASSIGNED, "A customer's name was edited"),
+ (EMAIL_ASSIGNED, "A customer's email address was edited"),
+ (NOTE_ADDED, "A note was added to the customer"),
]
diff --git a/saleor/account/models.py b/saleor/account/models.py
index daa8da7bc7..6ca52bcad7 100644
--- a/saleor/account/models.py
+++ b/saleor/account/models.py
@@ -12,7 +12,6 @@ from django.db import models
from django.db.models import Q, Value
from django.forms.models import model_to_dict
from django.utils import timezone
-from django.utils.translation import gettext_lazy as _, pgettext_lazy
from django_countries.fields import Country, CountryField
from oauthlib.common import generate_token
from phonenumber_field.modelfields import PhoneNumber, PhoneNumberField
@@ -158,14 +157,8 @@ class User(PermissionsMixin, ModelWithMetadata, AbstractBaseUser):
class Meta:
permissions = (
- (
- AccountPermissions.MANAGE_USERS.codename,
- pgettext_lazy("Permission description", "Manage customers."),
- ),
- (
- AccountPermissions.MANAGE_STAFF.codename,
- pgettext_lazy("Permission description", "Manage staff."),
- ),
+ (AccountPermissions.MANAGE_USERS.codename, "Manage customers."),
+ (AccountPermissions.MANAGE_STAFF.codename, "Manage staff."),
)
def get_full_name(self):
@@ -192,9 +185,9 @@ class ServiceAccount(ModelWithMetadata):
is_active = models.BooleanField(default=True)
permissions = models.ManyToManyField(
Permission,
- verbose_name=_("service account permissions"),
+ verbose_name="service account permissions",
blank=True,
- help_text=_("Specific permissions for this service."),
+ help_text="Specific permissions for this service.",
related_name="service_set",
related_query_name="service",
)
@@ -203,7 +196,7 @@ class ServiceAccount(ModelWithMetadata):
permissions = (
(
AccountPermissions.MANAGE_SERVICE_ACCOUNTS.codename,
- pgettext_lazy("Permission description", "Manage service account"),
+ "Manage service account",
),
)