From 37e158b9badd87df445383bb21f2cc7eeae7cb36 Mon Sep 17 00:00:00 2001 From: Siddharth Asthana Date: Wed, 18 Nov 2020 16:00:39 +0530 Subject: [PATCH] support: Rename message -> success_message. --- analytics/views.py | 26 +++++++++++++------------- templates/analytics/support.html | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/analytics/views.py b/analytics/views.py index 7398db60d5..b77b075c32 100644 --- a/analytics/views.py +++ b/analytics/views.py @@ -1125,57 +1125,57 @@ def support(request: HttpRequest) -> HttpResponse: current_plan_type = realm.plan_type do_change_plan_type(realm, new_plan_type) msg = f"Plan type of {realm.string_id} changed from {get_plan_name(current_plan_type)} to {get_plan_name(new_plan_type)} " - context["message"] = msg + context["success_message"] = msg elif request.POST.get("discount", None) is not None: new_discount = Decimal(request.POST.get("discount")) current_discount = get_discount_for_realm(realm) attach_discount_to_realm(realm, new_discount) msg = f"Discount of {realm.string_id} changed to {new_discount} from {current_discount} " - context["message"] = msg + context["success_message"] = msg elif request.POST.get("status", None) is not None: status = request.POST.get("status") if status == "active": do_send_realm_reactivation_email(realm) - context["message"] = f"Realm reactivation email sent to admins of {realm.string_id}." + context["success_message"] = f"Realm reactivation email sent to admins of {realm.string_id}." elif status == "deactivated": do_deactivate_realm(realm, request.user) - context["message"] = f"{realm.string_id} deactivated." + context["success_message"] = f"{realm.string_id} deactivated." elif request.POST.get("billing_method", None) is not None: billing_method = request.POST.get("billing_method") if billing_method == "send_invoice": update_billing_method_of_current_plan(realm, charge_automatically=False) - context["message"] = f"Billing method of {realm.string_id} updated to pay by invoice." + context["success_message"] = f"Billing method of {realm.string_id} updated to pay by invoice." elif billing_method == "charge_automatically": update_billing_method_of_current_plan(realm, charge_automatically=True) - context["message"] = f"Billing method of {realm.string_id} updated to charge automatically." + context["success_message"] = f"Billing method of {realm.string_id} updated to charge automatically." elif request.POST.get("sponsorship_pending", None) is not None: sponsorship_pending = request.POST.get("sponsorship_pending") if sponsorship_pending == "true": update_sponsorship_status(realm, True) - context["message"] = f"{realm.string_id} marked as pending sponsorship." + context["success_message"] = f"{realm.string_id} marked as pending sponsorship." elif sponsorship_pending == "false": update_sponsorship_status(realm, False) - context["message"] = f"{realm.string_id} is no longer pending sponsorship." + context["success_message"] = f"{realm.string_id} is no longer pending sponsorship." elif request.POST.get('approve_sponsorship') is not None: if request.POST.get('approve_sponsorship') == "approve_sponsorship": approve_sponsorship(realm) - context["message"] = f"Sponsorship approved for {realm.string_id}" + context["success_message"] = f"Sponsorship approved for {realm.string_id}" elif request.POST.get('downgrade_method', None) is not None: downgrade_method = request.POST.get('downgrade_method') if downgrade_method == "downgrade_at_billing_cycle_end": downgrade_at_the_end_of_billing_cycle(realm) - context["message"] = f"{realm.string_id} marked for downgrade at the end of billing cycle" + context["success_message"] = f"{realm.string_id} marked for downgrade at the end of billing cycle" elif downgrade_method == "downgrade_now_without_additional_licenses": downgrade_now_without_creating_additional_invoices(realm) - context["message"] = f"{realm.string_id} downgraded without creating additional invoices" + context["success_message"] = f"{realm.string_id} downgraded without creating additional invoices" elif downgrade_method == "downgrade_now_void_open_invoices": downgrade_now_without_creating_additional_invoices(realm) voided_invoices_count = void_all_open_invoices(realm) - context["message"] = f"{realm.string_id} downgraded and voided {voided_invoices_count} open invoices" + context["success_message"] = f"{realm.string_id} downgraded and voided {voided_invoices_count} open invoices" elif request.POST.get("scrub_realm", None) is not None: if request.POST.get("scrub_realm") == "scrub_realm": do_scrub_realm(realm, acting_user=request.user) - context["message"] = f"{realm.string_id} scrubbed." + context["success_message"] = f"{realm.string_id} scrubbed." query = request.GET.get("q", None) if query: diff --git a/templates/analytics/support.html b/templates/analytics/support.html index afee21debc..beda625a0f 100644 --- a/templates/analytics/support.html +++ b/templates/analytics/support.html @@ -18,10 +18,10 @@ - {% if message %} + {% if success_message %}
- {{ message }} + {{ success_message }}
{% endif %}