feat: improve customer address views
This commit is contained in:
+17
-7
@@ -36,8 +36,8 @@ class IndexView(TemplateView):
|
||||
}
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if self.request.GET.get('next'):
|
||||
return redirect(self.request.GET.get('next'))
|
||||
if self.request.GET.get("next"):
|
||||
return redirect(self.request.GET.get("next"))
|
||||
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
||||
@@ -230,7 +230,7 @@ def add_cart_item(request, *args, **kwargs):
|
||||
response = HttpResponse(status=201, headers={"HX-Trigger": "updated-cart"})
|
||||
|
||||
if created and request.user.is_anonymous:
|
||||
response.set_cookie(ANONYMOUS_CART_ID_COOKIE_NAME, cart.uuid)
|
||||
response.set_cookie(ANONYMOUS_CART_ID_COOKIE_NAME, cart.uuid, samesite="strict")
|
||||
|
||||
# Comprobamos si existe una línea de carrito para ese carrito de ese producto
|
||||
existing_cart_item = CartItem.objects.filter(cart=cart, product=product).first()
|
||||
@@ -309,11 +309,21 @@ def manifest(request, *args, **kwargs):
|
||||
"orientation": "portrait",
|
||||
}
|
||||
|
||||
if settings.logo_240:
|
||||
if settings.logo:
|
||||
data["icons"].append(
|
||||
{
|
||||
"src": settings.logo_240.url,
|
||||
"sizes": "240x240",
|
||||
"src": settings.logo.url,
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable any",
|
||||
}
|
||||
)
|
||||
|
||||
if settings.logo_256:
|
||||
data["icons"].append(
|
||||
{
|
||||
"src": settings.logo_256.url,
|
||||
"sizes": "256x256",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable any",
|
||||
}
|
||||
@@ -323,7 +333,7 @@ def manifest(request, *args, **kwargs):
|
||||
data["icons"].append(
|
||||
{
|
||||
"src": settings.logo_128.url,
|
||||
"sizes": "240x240",
|
||||
"sizes": "128x128",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable any",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user