diff --git a/ecommerce/extensions/api/v2/tests/views/test_baskets.py b/ecommerce/extensions/api/v2/tests/views/test_baskets.py index f0e2359046c..30c97e6ee9d 100644 --- a/ecommerce/extensions/api/v2/tests/views/test_baskets.py +++ b/ecommerce/extensions/api/v2/tests/views/test_baskets.py @@ -17,7 +17,7 @@ from oscar.test import factories from oscar.test.factories import BasketFactory from rest_framework.throttling import UserRateThrottle -from waffle.testutils import override_flag, override_switch +from waffle.testutils import override_flag from ecommerce.courses.models import Course from ecommerce.extensions.api import exceptions as api_exceptions @@ -582,7 +582,6 @@ def test_basket_calculate_does_not_call_tracking_events(self): @mock.patch('ecommerce.extensions.api.v2.views.baskets.BasketCalculateView._calculate_temporary_basket') @override_flag('disable_calculate_temporary_basket_atomic_transaction', active=True) - @override_switch('force_anonymous_user_response_for_basket_calculate', active=True) def test_basket_calculate_anonymous_caching(self, mock_calculate_basket): """Verify a request made with the is_anonymous parameter is cached""" url_with_one_sku = self._generate_sku_url(self.products[0:1], username=None) diff --git a/ecommerce/extensions/api/v2/views/baskets.py b/ecommerce/extensions/api/v2/views/baskets.py index 6a57ad681aa..c26b2a1996d 100644 --- a/ecommerce/extensions/api/v2/views/baskets.py +++ b/ecommerce/extensions/api/v2/views/baskets.py @@ -471,13 +471,8 @@ def get(self, request): # pylint: disable=too-many-statements basket_owner = request.user - if waffle.switch_is_active("force_anonymous_user_response_for_basket_calculate"): - # Use the anonymous user program price for all users - requested_username = '' - is_anonymous = True - else: - requested_username = request.GET.get('username', default='') - is_anonymous = request.GET.get('is_anonymous', 'false').lower() == 'true' + requested_username = request.GET.get('username', default='') + is_anonymous = request.GET.get('is_anonymous', 'false').lower() == 'true' use_default_basket = is_anonymous @@ -528,11 +523,7 @@ def get(self, request): # pylint: disable=too-many-statements if cached_response.is_hit: return Response(cached_response.value) - # There are too many open questions around dropping the atomic transaction for a user's basket, - # including how user basket merges was coded. For now, only allow disabling the atomic - # transaction if we are also forcing the anonymous basket response for all users. - if waffle.flag_is_active(request, "disable_calculate_temporary_basket_atomic_transaction")\ - and waffle.switch_is_active("force_anonymous_user_response_for_basket_calculate"): + if waffle.flag_is_active(request, "disable_calculate_temporary_basket_atomic_transaction"): response = self._calculate_temporary_basket(basket_owner, request, products, voucher, skus, code) else: response = self._calculate_temporary_basket_atomic(basket_owner, request, products, voucher, skus, code)