Features: 1) None;
Fixes: 1) Remove unused positional arguments from wishlist-related viewset methods; 2) Adjust `create` method to accept only required arguments; Extra: 1) Minor cleanup for method signatures in `core.viewsets.py`;
This commit is contained in:
parent
a90498a94a
commit
194e2bef78
1 changed files with 5 additions and 6 deletions
|
|
@ -469,7 +469,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:
|
||||
|
|
@ -486,7 +486,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:
|
||||
|
|
@ -503,7 +503,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:
|
||||
|
|
@ -520,7 +520,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:
|
||||
|
|
@ -551,8 +551,7 @@ class AddressViewSet(EvibesViewSet):
|
|||
return AddressAutocompleteInputSerializer
|
||||
return AddressSerializer
|
||||
|
||||
@action(detail=False, methods=["post"])
|
||||
def create(self, request):
|
||||
def create(self, request, **kwargs):
|
||||
serializer = AddressCreateSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue