/billing/: Rename "payment.html" => "billing.html".

This matches the URL path /billing/ to the filename "billing.html".
This commit is contained in:
Brock Whittaker 2018-01-29 16:30:02 -08:00 committed by Greg Price
parent 43a6439b3b
commit 3b600d5591
3 changed files with 6 additions and 6 deletions

View File

@ -526,7 +526,7 @@ def build_custom_checkers(by_lang):
'bad_lines': ['<button aria-label="foo"></button>']},
{'pattern': 'script src="http',
'description': "Don't directly load dependencies from CDNs. See docs/subsystems/front-end-build-process.md",
'exclude': set(["templates/zilencer/payment.html"]),
'exclude': set(["templates/zilencer/billing.html"]),
'good_lines': ["{{ render_bundle('landing-page') }}"],
'bad_lines': ['<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>']},
{'pattern': "title='[^{]",

View File

@ -132,11 +132,11 @@ def add_payment_method(request: HttpRequest) -> HttpResponse:
if not user.is_realm_admin:
ctx["error_message"] = _("You should be an administrator of the organization %s to view this page."
% (user.realm.name,))
return render(request, 'zilencer/payment.html', context=ctx)
return render(request, 'zilencer/billing.html', context=ctx)
if STRIPE_PUBLISHABLE_KEY is None:
# Dev-only message; no translation needed.
ctx["error_message"] = "Missing Stripe config. In dev, add to zproject/dev-secrets.conf ."
return render(request, 'zilencer/payment.html', context=ctx)
return render(request, 'zilencer/billing.html', context=ctx)
try:
if request.method == "GET":
@ -146,7 +146,7 @@ def add_payment_method(request: HttpRequest) -> HttpResponse:
ctx["num_cards"] = len(cards["data"])
except Customer.DoesNotExist:
ctx["num_cards"] = 0
return render(request, 'zilencer/payment.html', context=ctx)
return render(request, 'zilencer/billing.html', context=ctx)
if request.method == "POST":
token = request.POST.get("stripeToken", "")
@ -178,7 +178,7 @@ def add_payment_method(request: HttpRequest) -> HttpResponse:
Customer.objects.create(realm=user.realm, stripe_customer_id=customer.id)
ctx["num_cards"] = 1
ctx["payment_method_added"] = True
return render(request, 'zilencer/payment.html', context=ctx)
return render(request, 'zilencer/billing.html', context=ctx)
except StripeError as e:
billing_logger.error("Stripe error: %d %s", e.http_status, e.__class__.__name__)
if isinstance(e, CardError):
@ -186,7 +186,7 @@ def add_payment_method(request: HttpRequest) -> HttpResponse:
else:
ctx["error_message"] = _("Something went wrong. Please try again or email us at %s."
% (settings.ZULIP_ADMINISTRATOR,))
return render(request, 'zilencer/payment.html', context=ctx)
return render(request, 'zilencer/billing.html', context=ctx)
except Exception as e:
billing_logger.exception("Uncaught error in billing")
raise