From d55026b69d3e6b5ee30f57a5d141361d9e0307f5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 07:06:40 +0000 Subject: [PATCH 1/2] Initial plan From a94c256ad53606bf0abee6826f0abe7e7d03a42d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 07:18:04 +0000 Subject: [PATCH 2/2] Changes before error encountered Agent-Logs-Url: https://github.com/dsaub/proyecto-final/sessions/f8687aac-de86-402f-b36d-ea422d24ed8e Co-authored-by: dsaub <54474838+dsaub@users.noreply.github.com> --- tienda/templates/tienda/home.html | 8 +++++--- tienda/templates/tienda/search.html | 8 +++++--- tienda/views.py | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tienda/templates/tienda/home.html b/tienda/templates/tienda/home.html index 4465721..3e28fb3 100644 --- a/tienda/templates/tienda/home.html +++ b/tienda/templates/tienda/home.html @@ -196,9 +196,11 @@ Ver detalles - - 🛒 - +
diff --git a/tienda/templates/tienda/search.html b/tienda/templates/tienda/search.html index 3641bdd..7fc8385 100644 --- a/tienda/templates/tienda/search.html +++ b/tienda/templates/tienda/search.html @@ -79,9 +79,11 @@ Ver detalles - - 🛒 - + diff --git a/tienda/views.py b/tienda/views.py index a44db6b..b5af383 100644 --- a/tienda/views.py +++ b/tienda/views.py @@ -16,6 +16,7 @@ from .vars import ( ) from django.conf import settings from django.views.decorators.csrf import csrf_exempt +from django.views.decorators.http import require_POST from django.urls import reverse from django.utils import timezone from decimal import Decimal, ROUND_HALF_UP @@ -704,6 +705,7 @@ def create_order_from_cart(request, payment_method, payment_reference="", shippi return order, "" +@require_POST def add_to_cart(request: HttpRequest, product_id: int): """Agrega un producto al carrito""" try: