diff --git a/backend/api/orders_views.py b/backend/api/orders_views.py index b98804c..b263cd5 100644 --- a/backend/api/orders_views.py +++ b/backend/api/orders_views.py @@ -167,6 +167,9 @@ def destroy(self, *args, **kwargs): ) shopping_cart.remove(product_id) logger.info(MESSAGE_ON_DELETE) + # TODO: add details on fields types and responses after __iter__ method + # (as there are no serializer) to api docs (swagger) for shopping cart list + # and shopping cart post endpoints return Response( { "products": shopping_cart.__iter__(), diff --git a/backend/orders/shopping_carts.py b/backend/orders/shopping_carts.py index 74a963d..50f2d73 100644 --- a/backend/orders/shopping_carts.py +++ b/backend/orders/shopping_carts.py @@ -1,6 +1,5 @@ -from datetime import datetime, timezone - from django.conf import settings +from django.utils import timezone from products.models import Product @@ -27,7 +26,7 @@ def add(self, product, quantity): "category": p.category.slug, "quantity": quantity, "final_price": p.final_price, - "created_at": int(datetime.now(timezone.utc).timestamp()), + "created_at": timezone.localtime().isoformat(), "amount": p.amount, "measure_unit": p.measure_unit, }