diff --git a/core/filters.py b/core/filters.py index f36915cb..20dfc386 100644 --- a/core/filters.py +++ b/core/filters.py @@ -212,10 +212,14 @@ class OrderFilter(FilterSet): user_email = CharFilter(field_name="user__email", lookup_expr="iexact") user = UUIDFilter(field_name="user__uuid", lookup_expr="exact") status = CharFilter(field_name="status", lookup_expr="icontains", label="Status") + human_readable_id = CharFilter(field_name="human_readable_id", lookup_expr="exact") order_by = OrderingFilter( fields=( ("uuid", "uuid"), + ("human_readable_id", "human_readable_id"), + ("user_email", "user_email"), + ("user", "user"), ("status", "status"), ("created", "created"), ("modified", "modified"), @@ -226,7 +230,7 @@ class OrderFilter(FilterSet): class Meta: model = Order - fields = ["uuid", "user_email", "user", "status", "order_by"] + fields = ["uuid", "human_readable_id", "user_email", "user", "status", "order_by"] class WishlistFilter(FilterSet): diff --git a/core/locale/ru_RU/LC_MESSAGES/django.mo b/core/locale/ru_RU/LC_MESSAGES/django.mo index 9474c3ab..0fb4855f 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 a5ab7353..8f159e0a 100644 --- a/core/locale/ru_RU/LC_MESSAGES/django.po +++ b/core/locale/ru_RU/LC_MESSAGES/django.po @@ -1140,7 +1140,7 @@ msgstr "Временная метка, когда заказ был заверш #: core/models.py:491 msgid "buy time" -msgstr "Выиграть время" +msgstr "Время покупки" #: core/models.py:498 msgid "a human-readable identifier for the order" diff --git a/core/models.py b/core/models.py index 8dcab745..65f54ad2 100644 --- a/core/models.py +++ b/core/models.py @@ -741,6 +741,7 @@ class Order(NiceModel): "customer_name": customer_name, "customer_email": customer_email, "customer_phone_number": customer_phone_number, + "is_business": kwargs.get("is_business", False), } ) self.save() diff --git a/core/views.py b/core/views.py index bdd62a1c..4386585f 100644 --- a/core/views.py +++ b/core/views.py @@ -217,6 +217,7 @@ class BuyAsBusinessView(APIView): customer_billing_address=serializer.validated_data.get("customer_billing_address"), customer_shipping_address=serializer.validated_data.get("customer_shipping_address"), payment_method=serializer.validated_data.get("payment_method"), + is_business=True, ) return Response(status=status.HTTP_202_ACCEPTED, data=TransactionProcessSerializer(transaction).data)