Browse Source

Don't validate plan_id if it has not changed from the old value (when updating payment method).

pull/293/head
Pēteris Caune 5 years ago
parent
commit
b0db5181d8
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      hc/payments/views.py

+ 3
- 3
hc/payments/views.py View File

@ -91,9 +91,6 @@ def update(request):
plan_id = request.POST["plan_id"]
nonce = request.POST["nonce"]
if plan_id not in ("", "P20", "P80", "Y192", "Y768"):
return HttpResponseBadRequest()
sub = Subscription.objects.for_user(request.user)
# If plan_id has not changed then just update the payment method:
if plan_id == sub.plan_id:
@ -104,6 +101,9 @@ def update(request):
request.session["payment_method_status"] = "success"
return redirect("hc-billing")
if plan_id not in ("", "P20", "P80", "Y192", "Y768"):
return HttpResponseBadRequest()
# Cancel the previous plan and reset limits:
sub.cancel()


Loading…
Cancel
Save