diff --git a/core/crm/amo/gateway.py b/core/crm/amo/gateway.py index 19ee2585..4fff14a5 100644 --- a/core/crm/amo/gateway.py +++ b/core/crm/amo/gateway.py @@ -82,9 +82,14 @@ class AmoCRM: def _get_customer_name(self, order: Order) -> str: if not order.attributes.get("business_identificator"): - return order.user.get_full_name() or ( - f"{order.attributes.get('customer_name')} | " - f"{order.attributes.get('customer_phone_number') or order.attributes.get('customer_email')}" + 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") diff --git a/core/locale/ru_RU/LC_MESSAGES/django.mo b/core/locale/ru_RU/LC_MESSAGES/django.mo index a4b0facc..4bf7a31f 100644 Binary files a/core/locale/ru_RU/LC_MESSAGES/django.mo and b/core/locale/ru_RU/LC_MESSAGES/django.mo differ diff --git a/core/locale/ru_RU/LC_MESSAGES/django.po b/core/locale/ru_RU/LC_MESSAGES/django.po index e5bb3e2e..2e934903 100644 --- a/core/locale/ru_RU/LC_MESSAGES/django.po +++ b/core/locale/ru_RU/LC_MESSAGES/django.po @@ -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" diff --git a/core/models.py b/core/models.py index e5e2303f..8924c846 100644 --- a/core/models.py +++ b/core/models.py @@ -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: diff --git a/core/serializers/utility.py b/core/serializers/utility.py index ff68a104..e7be7054 100644 --- a/core/serializers/utility.py +++ b/core/serializers/utility.py @@ -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: diff --git a/vibes_auth/locale/ru_RU/LC_MESSAGES/django.mo b/vibes_auth/locale/ru_RU/LC_MESSAGES/django.mo index 914d76fb..4d3253d2 100644 Binary files a/vibes_auth/locale/ru_RU/LC_MESSAGES/django.mo and b/vibes_auth/locale/ru_RU/LC_MESSAGES/django.mo differ diff --git a/vibes_auth/locale/ru_RU/LC_MESSAGES/django.po b/vibes_auth/locale/ru_RU/LC_MESSAGES/django.po index d64929b2..033459b3 100644 --- a/vibes_auth/locale/ru_RU/LC_MESSAGES/django.po +++ b/vibes_auth/locale/ru_RU/LC_MESSAGES/django.po @@ -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"