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,9 +82,14 @@ class AmoCRM:
|
||||||
|
|
||||||
def _get_customer_name(self, order: Order) -> str:
|
def _get_customer_name(self, order: Order) -> str:
|
||||||
if not order.attributes.get("business_identificator"):
|
if not order.attributes.get("business_identificator"):
|
||||||
return order.user.get_full_name() or (
|
return (
|
||||||
f"{order.attributes.get('customer_name')} | "
|
order.user.get_full_name()
|
||||||
f"{order.attributes.get('customer_phone_number') or order.attributes.get('customer_email')}"
|
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:
|
try:
|
||||||
business_identificator = order.attributes.get("business_identificator")
|
business_identificator = order.attributes.get("business_identificator")
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -2133,7 +2133,7 @@ msgstr "человекочитаемый идентификатор"
|
||||||
|
|
||||||
#: core/models.py:1261
|
#: core/models.py:1261
|
||||||
msgid "order"
|
msgid "order"
|
||||||
msgstr "Заказать"
|
msgstr "Заказ"
|
||||||
|
|
||||||
#: core/models.py:1282
|
#: core/models.py:1282
|
||||||
msgid "a user must have only one pending order at a time"
|
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(
|
def add_product(
|
||||||
self,
|
self,
|
||||||
product_uuid=None,
|
product_uuid=None,
|
||||||
attributes: list | None = None,
|
attributes: list | dict | None = None,
|
||||||
update_quantity=True,
|
update_quantity=True,
|
||||||
):
|
):
|
||||||
if attributes is None:
|
if attributes is None:
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class AddressCreateSerializer(ModelSerializer):
|
||||||
write_only=True,
|
write_only=True,
|
||||||
max_length=512,
|
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)
|
address_line_2 = CharField(write_only=True, max_length=128, required=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -20,7 +20,7 @@ msgstr "Баланс"
|
||||||
|
|
||||||
#: vibes_auth/admin.py:45
|
#: vibes_auth/admin.py:45
|
||||||
msgid "order"
|
msgid "order"
|
||||||
msgstr "Заказать"
|
msgstr "Заказ"
|
||||||
|
|
||||||
#: vibes_auth/admin.py:46 vibes_auth/graphene/object_types.py:44
|
#: vibes_auth/admin.py:46 vibes_auth/graphene/object_types.py:44
|
||||||
msgid "orders"
|
msgid "orders"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue