Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: more quality
Browse files Browse the repository at this point in the history
  • Loading branch information
grmartin committed Jul 3, 2024
1 parent 45499ec commit b73add6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ecommerce/coupons/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ def get(self, request): # pylint: disable=too-many-statements
# TODO: It would be cleaner if the user could be redirected to their final destination up front.
redirect_url = get_payment_microfrontend_or_basket_url(self.request) + "?coupon_redeem_redirect=1"

# Check for the paypal_redirect=1 parameter from the ecommerece checkout and add it to the redirect URL if present
# Check for the paypal_redirect=1 parameter from the ecommerece checkout and add it to the
# redirect URL if present
paypal_redirect = request.GET.get('paypal_redirect')

if paypal_redirect:
Expand Down
6 changes: 4 additions & 2 deletions ecommerce/extensions/basket/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,13 @@ def _redirect_response_to_basket_or_payment(self, request, invalid_code=None):
redirect_url = add_utm_params_to_url(redirect_url, list(self.request.GET.items()))
redirect_url = add_invalid_code_message_to_url(redirect_url, invalid_code)

# Check for the paypal_redirect=1 parameter from the ecommerece checkout and add it to the redirect URL if present
# Check for the paypal_redirect=1 parameter from the ecommerece checkout and add it to the
# redirect URL if present
paypal_redirect = request.GET.get('paypal_redirect')

if paypal_redirect:
redirect_url += "?paypal_redirect=1"
concat_char = "&" if "?" in redirect_url else "?"
redirect_url += f"{concat_char}paypal_redirect=1"
redirect_url = add_stripe_flag_to_url(redirect_url, request)

return HttpResponseRedirect(redirect_url, status=303)
Expand Down

0 comments on commit b73add6

Please sign in to comment.