Features: 1) Set address_line_1 as a required field in the serializer;
Fixes: 1) Update Russian locale translation for "order" and "orders"; Extra: 1) Adjust minor formatting in Russian locale files.
This commit is contained in:
parent
3324e5d36b
commit
a4ec737334
7 changed files with 12 additions and 7 deletions
|
|
@ -82,10 +82,15 @@ class AmoCRM:
|
|||
|
||||
def _get_customer_name(self, order: Order) -> str:
|
||||
if not order.attributes.get("business_identificator"):
|
||||
return order.user.get_full_name() or (
|
||||
return (
|
||||
order.user.get_full_name()
|
||||
if order.user
|
||||
else None
|
||||
or (
|
||||
f"{order.attributes.get('customer_name')} | "
|
||||
f"{order.attributes.get('customer_phone_number') or order.attributes.get('customer_email')}"
|
||||
)
|
||||
)
|
||||
try:
|
||||
business_identificator = order.attributes.get("business_identificator")
|
||||
r = requests.get(
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -2133,7 +2133,7 @@ msgstr "человекочитаемый идентификатор"
|
|||
|
||||
#: core/models.py:1261
|
||||
msgid "order"
|
||||
msgstr "Заказать"
|
||||
msgstr "Заказ"
|
||||
|
||||
#: core/models.py:1282
|
||||
msgid "a user must have only one pending order at a time"
|
||||
|
|
|
|||
|
|
@ -1306,7 +1306,7 @@ class Order(ExportModelOperationsMixin("order"), NiceModel): # type: ignore [mi
|
|||
def add_product(
|
||||
self,
|
||||
product_uuid=None,
|
||||
attributes: list | None = None,
|
||||
attributes: list | dict | None = None,
|
||||
update_quantity=True,
|
||||
):
|
||||
if attributes is None:
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class AddressCreateSerializer(ModelSerializer):
|
|||
write_only=True,
|
||||
max_length=512,
|
||||
)
|
||||
address_line_1 = CharField(write_only=True, max_length=128, required=False)
|
||||
address_line_1 = CharField(write_only=True, max_length=128, required=True)
|
||||
address_line_2 = CharField(write_only=True, max_length=128, required=False)
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -20,7 +20,7 @@ msgstr "Баланс"
|
|||
|
||||
#: vibes_auth/admin.py:45
|
||||
msgid "order"
|
||||
msgstr "Заказать"
|
||||
msgstr "Заказ"
|
||||
|
||||
#: vibes_auth/admin.py:46 vibes_auth/graphene/object_types.py:44
|
||||
msgid "orders"
|
||||
|
|
|
|||
Loading…
Reference in a new issue