Merge branch 'main' into storefront-astro-vue
This commit is contained in:
commit
7b533ffa74
34 changed files with 79 additions and 92 deletions
|
|
@ -72,6 +72,13 @@ db_backups/
|
|||
services_data/
|
||||
static/
|
||||
media/
|
||||
!core/static
|
||||
!blog/static
|
||||
!vibes_auth/static
|
||||
!payments/static
|
||||
|
||||
# Environment file
|
||||
.env
|
||||
|
||||
# Host's scripts
|
||||
scripts
|
||||
|
|
@ -28,5 +28,8 @@ storefront/ @SaVBaD savbad@wiseless.xyz
|
|||
*.mo @fureunoir contact@fureunoir.com
|
||||
*.html @SaVBaD savbad@wiseless.xyz
|
||||
*.js @SaVBaD savbad@wiseless.xyz
|
||||
*.mjs @SaVBaD savbad@wiseless.xyz
|
||||
*.cjs @SaVBaD savbad@wiseless.xyz
|
||||
*.vue @SaVBaD savbad@wiseless.xyz
|
||||
*.astro @SaVBaD savbad@wiseless.xyz
|
||||
*.scss @SaVBaD savbad@wiseless.xyz
|
||||
|
|
|
|||
0
blog/static/.gitkeep
Normal file
0
blog/static/.gitkeep
Normal file
Binary file not shown.
|
|
@ -615,10 +615,8 @@ msgstr "Automatické dokončování zadávání adresy"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Řetězec dotazu na nezpracovaná data, doplňte prosím data z koncového bodu "
|
||||
"geo-IP"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -621,11 +621,7 @@ msgstr "Automatisk udfyldning af adresseinput"
|
|||
|
||||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
msgstr "Rå dataforespørgselsstreng, tilføj venligst data fra geo-IP-slutpunkt"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -603,11 +603,7 @@ msgstr "Autocomplete address input"
|
|||
|
||||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
msgstr "Raw data query string, please append with data from geo-IP endpoint"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -598,11 +598,7 @@ msgstr "Autocomplete address input"
|
|||
|
||||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
msgstr "Raw data query string, please append with data from geo-IP endpoint"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -626,10 +626,8 @@ msgstr "Autocompletar direcciones"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Cadena de consulta de datos sin procesar, adjunte los datos del punto final "
|
||||
"geo-IP"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -630,10 +630,8 @@ msgstr "Saisie automatique des adresses"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Chaîne de requête de données brutes, à compléter avec les données du point "
|
||||
"d'extrémité géo-IP"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -632,10 +632,7 @@ msgstr "Inserimento automatico dell'indirizzo"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Stringa di query dei dati grezzi, da aggiungere ai dati dell'endpoint geo-IP"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -631,10 +631,8 @@ msgstr "Automatische adresinvoer"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Ruwe gegevensquerystring, gelieve aan te vullen met gegevens van geo-IP "
|
||||
"eindpunt"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -625,10 +625,8 @@ msgstr "Wprowadzanie adresu w trybie autouzupełniania"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Ciąg zapytania danych nieprzetworzonych, należy dołączyć dane z punktu "
|
||||
"końcowego geo-IP"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -618,10 +618,8 @@ msgstr "Entrada de endereço com preenchimento automático"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Cadeia de consulta de dados brutos, anexe os dados do ponto de extremidade "
|
||||
"de IP geográfico"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -628,10 +628,8 @@ msgstr "Автозаполнение ввода адреса"
|
|||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
"Строка запроса сырых данных, пожалуйста, дополните ее данными с конечной "
|
||||
"точки geo-IP"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -583,11 +583,7 @@ msgstr "自动完成地址输入"
|
|||
|
||||
#: core/docs/drf/viewsets.py:495
|
||||
msgid "raw data query string, please append with data from geo-IP endpoint"
|
||||
msgstr ""
|
||||
"docker compose exec app poetry run python manage.py deepl_translate -l en-gb"
|
||||
" -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l "
|
||||
"it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-"
|
||||
"hans -a core -a geo -a payments -a vibes_auth -a blog"
|
||||
msgstr "原始数据查询字符串,请附加来自地理 IP 端点的数据"
|
||||
|
||||
#: core/docs/drf/viewsets.py:501
|
||||
msgid "limit the results amount, 1 < limit < 10, default: 5"
|
||||
|
|
|
|||
|
|
@ -68,10 +68,7 @@ class EvibesPermission(permissions.BasePermission):
|
|||
if request.user.has_perm(f"{app_label}.{codename}"):
|
||||
return True
|
||||
|
||||
return bool(
|
||||
action in ("list", "retrieve")
|
||||
and getattr(model, "is_publicly_visible", False)
|
||||
)
|
||||
return bool(action in ("list", "retrieve") and getattr(model, "is_publicly_visible", False))
|
||||
|
||||
def has_object_permission(self, request, view, obj):
|
||||
if request.method in permissions.SAFE_METHODS:
|
||||
|
|
|
|||
|
|
@ -158,24 +158,12 @@ class AddressCreateSerializer(ModelSerializer): # noqa: F405
|
|||
write_only=True,
|
||||
max_length=512,
|
||||
)
|
||||
address_line_1 = CharField(
|
||||
write_only=True,
|
||||
max_length=128,
|
||||
required=False
|
||||
)
|
||||
address_line_2 = CharField(
|
||||
write_only=True,
|
||||
max_length=128,
|
||||
required=False
|
||||
)
|
||||
address_line_1 = CharField(write_only=True, max_length=128, required=False)
|
||||
address_line_2 = CharField(write_only=True, max_length=128, required=False)
|
||||
|
||||
class Meta:
|
||||
model = Address
|
||||
fields = [
|
||||
"raw_data",
|
||||
"address_line_1",
|
||||
"address_line_2"
|
||||
]
|
||||
fields = ["raw_data", "address_line_1", "address_line_2"]
|
||||
|
||||
def create(self, validated_data):
|
||||
raw = validated_data.pop("raw_data")
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ from core.serializers import (
|
|||
AddressAutocompleteInputSerializer,
|
||||
AddressCreateSerializer,
|
||||
AddressSerializer,
|
||||
AddressSuggestionSerializer,
|
||||
AddWishlistProductSerializer,
|
||||
AttributeDetailSerializer,
|
||||
AttributeGroupDetailSerializer,
|
||||
|
|
@ -244,7 +245,7 @@ class OrderViewSet(EvibesViewSet):
|
|||
return qs.filter(user=user)
|
||||
|
||||
@action(detail=False, methods=["get"], url_path="current")
|
||||
def current(self, request, *_args, **kwargs):
|
||||
def current(self, request):
|
||||
if not request.user.is_authenticated:
|
||||
raise PermissionDenied(permission_denied_message)
|
||||
order = Order.objects.get(user=request.user, status="PENDING")
|
||||
|
|
@ -259,8 +260,9 @@ class OrderViewSet(EvibesViewSet):
|
|||
def buy(self, request, *_args, **kwargs):
|
||||
serializer = BuyOrderSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
order_uuid = kwargs.get("pk")
|
||||
try:
|
||||
order = Order.objects.get(user=request.user, uuid=kwargs.get("order_uuid"))
|
||||
order = Order.objects.get(user=request.user, uuid=order_uuid)
|
||||
instance = order.buy(
|
||||
force_balance=serializer.validated_data.get("force_balance"),
|
||||
force_payment=serializer.validated_data.get("force_payment"),
|
||||
|
|
@ -276,11 +278,11 @@ class OrderViewSet(EvibesViewSet):
|
|||
case _:
|
||||
raise TypeError(_(f"wrong type came from order.buy() method: {type(instance)!s}"))
|
||||
except Order.DoesNotExist:
|
||||
return Response(status=status.HTTP_404_NOT_FOUND)
|
||||
return Response(status=status.HTTP_404_NOT_FOUND, data={"detail": _(f"order {order_uuid} not found")})
|
||||
|
||||
@action(detail=False, methods=["post"], url_path="buy_unregistered")
|
||||
@ratelimit(key="ip", rate="2/h", block=True)
|
||||
def buy_unregistered(self, request, *_args, **kwargs):
|
||||
def buy_unregistered(self, request):
|
||||
serializer = BuyUnregisteredOrderSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
order = Order.objects.create(status="MOMENTAL")
|
||||
|
|
@ -298,7 +300,7 @@ class OrderViewSet(EvibesViewSet):
|
|||
return Response(status=status.HTTP_202_ACCEPTED, data=TransactionProcessSerializer(transaction).data)
|
||||
|
||||
@action(detail=True, methods=["post"], url_path="add_order_product")
|
||||
def add_order_product(self, request, *_args, **kwargs):
|
||||
def add_order_product(self, request, **kwargs):
|
||||
serializer = AddOrderProductSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
try:
|
||||
|
|
@ -316,7 +318,7 @@ class OrderViewSet(EvibesViewSet):
|
|||
return Response(status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
@action(detail=True, methods=["post"], url_path="remove_order_product")
|
||||
def remove_order_product(self, request, *_args, **kwargs):
|
||||
def remove_order_product(self, request, **kwargs):
|
||||
serializer = RemoveOrderProductSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
try:
|
||||
|
|
@ -456,7 +458,7 @@ class WishlistViewSet(EvibesViewSet):
|
|||
return qs.filter(user=user)
|
||||
|
||||
@action(detail=False, methods=["get"], url_path="current")
|
||||
def current(self, request, *_args, **kwargs):
|
||||
def current(self, request):
|
||||
if not request.user.is_authenticated:
|
||||
raise PermissionDenied(permission_denied_message)
|
||||
wishlist = Wishlist.objects.get(user=request.user)
|
||||
|
|
@ -468,7 +470,7 @@ class WishlistViewSet(EvibesViewSet):
|
|||
)
|
||||
|
||||
@action(detail=True, methods=["post"], url_path="add_wishlist_product")
|
||||
def add_wishlist_product(self, request, *_args, **kwargs):
|
||||
def add_wishlist_product(self, request, **kwargs):
|
||||
serializer = AddWishlistProductSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
try:
|
||||
|
|
@ -485,7 +487,7 @@ class WishlistViewSet(EvibesViewSet):
|
|||
return Response(status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
@action(detail=True, methods=["post"], url_path="remove_wishlist_product")
|
||||
def remove_wishlist_product(self, request, *_args, **kwargs):
|
||||
def remove_wishlist_product(self, request, **kwargs):
|
||||
serializer = RemoveWishlistProductSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
try:
|
||||
|
|
@ -502,7 +504,7 @@ class WishlistViewSet(EvibesViewSet):
|
|||
return Response(status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
@action(detail=True, methods=["post"], url_path="bulk_add_wishlist_product")
|
||||
def bulk_add_wishlist_products(self, request, *_args, **kwargs):
|
||||
def bulk_add_wishlist_products(self, request, **kwargs):
|
||||
serializer = BulkAddWishlistProductSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
try:
|
||||
|
|
@ -519,7 +521,7 @@ class WishlistViewSet(EvibesViewSet):
|
|||
return Response(status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
@action(detail=True, methods=["post"], url_path="bulk_remove_wishlist_product")
|
||||
def bulk_remove_wishlist_products(self, request, *_args, **kwargs):
|
||||
def bulk_remove_wishlist_products(self, request, **kwargs):
|
||||
serializer = BulkRemoveWishlistProductSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
try:
|
||||
|
|
@ -538,6 +540,7 @@ class WishlistViewSet(EvibesViewSet):
|
|||
|
||||
@extend_schema_view(**ADDRESS_SCHEMA)
|
||||
class AddressViewSet(EvibesViewSet):
|
||||
pagination_class = None
|
||||
queryset = Address.objects.all()
|
||||
serializer_class = AddressSerializer
|
||||
additional = {"create": "ALLOW"}
|
||||
|
|
@ -549,6 +552,19 @@ class AddressViewSet(EvibesViewSet):
|
|||
return AddressAutocompleteInputSerializer
|
||||
return AddressSerializer
|
||||
|
||||
def create(self, request, **kwargs):
|
||||
create_serializer = AddressCreateSerializer(data=request.data, context={"request": request})
|
||||
create_serializer.is_valid(raise_exception=True)
|
||||
|
||||
address_obj = create_serializer.create(create_serializer.validated_data)
|
||||
|
||||
output_serializer = AddressSerializer(address_obj, context={"request": request})
|
||||
|
||||
return Response(
|
||||
status=status.HTTP_201_CREATED,
|
||||
data=output_serializer.data,
|
||||
)
|
||||
|
||||
@action(detail=False, methods=["get"], url_path="autocomplete")
|
||||
def autocomplete(self, request):
|
||||
serializer = AddressAutocompleteInputSerializer(data=request.query_params)
|
||||
|
|
@ -559,14 +575,17 @@ class AddressViewSet(EvibesViewSet):
|
|||
|
||||
try:
|
||||
suggestions = fetch_address_suggestions(query=q, limit=limit)
|
||||
serializer = AddressSuggestionSerializer(suggestions, many=True)
|
||||
return Response(
|
||||
serializer.data,
|
||||
status=status.HTTP_200_OK,
|
||||
)
|
||||
except Exception as e:
|
||||
return Response(
|
||||
{"detail": _(f"Geocoding error: {e}")},
|
||||
status=status.HTTP_502_BAD_GATEWAY,
|
||||
)
|
||||
|
||||
return Response(suggestions, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class ProductTagViewSet(EvibesViewSet):
|
||||
queryset = ProductTag.objects.all()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from rest_framework.fields import FloatField, JSONField
|
||||
from rest_framework.fields import FloatField, JSONField, SerializerMethodField
|
||||
from rest_framework.serializers import ModelSerializer, Serializer
|
||||
|
||||
from payments.models import Transaction
|
||||
|
|
@ -16,6 +16,14 @@ class TransactionSerializer(ModelSerializer):
|
|||
|
||||
class TransactionProcessSerializer(ModelSerializer):
|
||||
process = JSONField(required=True)
|
||||
order_hr_id = SerializerMethodField(read_only=True, required=False)
|
||||
order_uuid = SerializerMethodField(read_only=True, required=False)
|
||||
|
||||
def get_order_hr_id(self, obj: Transaction):
|
||||
return obj.order.human_readable_id if obj.order else None
|
||||
|
||||
def get_order_uuid(self, obj: Transaction):
|
||||
return obj.order.uuid if obj.order else None
|
||||
|
||||
class Meta:
|
||||
model = Transaction
|
||||
|
|
|
|||
0
payments/static/.gitkeep
Normal file
0
payments/static/.gitkeep
Normal file
|
|
@ -94,8 +94,9 @@ class UserSerializer(ModelSerializer):
|
|||
Returns a list of serialized ProductSimpleSerializer representations
|
||||
for the UUIDs in obj.recently_viewed.
|
||||
"""
|
||||
return ProductSimpleSerializer(Product.objects.filter(uuid__in=obj.recently_viewed, is_active=True),
|
||||
many=True).data
|
||||
return ProductSimpleSerializer(
|
||||
Product.objects.filter(uuid__in=obj.recently_viewed, is_active=True), many=True
|
||||
).data
|
||||
|
||||
|
||||
class TokenObtainSerializer(Serializer):
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ class UserViewSet(
|
|||
@method_decorator(ratelimit(key="ip", rate="2/h" if not DEBUG else "888/h"))
|
||||
def confirm_password_reset(self, request, *args, **kwargs):
|
||||
try:
|
||||
|
||||
if not compare_digest(request.data.get("password"), request.data.get("confirm_password")):
|
||||
return Response(
|
||||
{"error": _("passwords do not match")},
|
||||
|
|
@ -151,6 +150,4 @@ class UserViewSet(
|
|||
instance = self.get_object()
|
||||
serializer = self.get_serializer(instance)
|
||||
instance = serializer.update(instance=self.get_object(), validated_data=request.data)
|
||||
return Response(
|
||||
self.get_serializer(instance.data)
|
||||
)
|
||||
return Response(self.get_serializer(instance.data))
|
||||
|
|
|
|||
Loading…
Reference in a new issue