From e2841fb39f37867ffcaa8adfc148c42f947be373 Mon Sep 17 00:00:00 2001 From: earlinn Date: Fri, 5 Jan 2024 15:20:20 +0600 Subject: [PATCH] Fix coupon_apply endpoint --- backend/api/orders_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/api/orders_views.py b/backend/api/orders_views.py index f261b01..b4e4e65 100644 --- a/backend/api/orders_views.py +++ b/backend/api/orders_views.py @@ -180,7 +180,7 @@ def coupon_apply(self, request): status=status.HTTP_201_CREATED, ) except Coupon.DoesNotExist: - request.session["coupon_id"] = coupon.id + request.session["coupon_id"] = None return Response( {"errors": COUPON_ERROR_MESSAGE.format(code=code)}, status=status.HTTP_403_FORBIDDEN,