support: Update success message for plan type change.

This commit is contained in:
Rishi Gupta
2019-05-07 21:10:09 -07:00
committed by Tim Abbott
parent 42c37ef2ee
commit 0218da64f1
2 changed files with 4 additions and 3 deletions

View File

@@ -406,7 +406,7 @@ class TestSupportEndpoint(ZulipTestCase):
with mock.patch("analytics.views.do_change_plan_type") as m:
result = self.client_post("/activity/support", {"realm_id": "1", "plan_type": "2"})
m.assert_called_once_with(get_realm("zulip"), 2)
self.assert_in_success_response(["Plan type of Zulip Dev changed to limited from self hosted"], result)
self.assert_in_success_response(["Plan type of Zulip Dev changed from self hosted to limited"], result)
def test_attach_discount(self) -> None:
cordelia_email = self.example_email("cordelia")

View File

@@ -1041,8 +1041,9 @@ def support(request: HttpRequest) -> HttpResponse:
new_plan_type = int(new_plan_type)
current_plan_type = realm.plan_type
do_change_plan_type(realm, new_plan_type)
msg = "Plan type of {} changed to {} from {} ".format(realm.name, get_plan_name(new_plan_type),
get_plan_name(current_plan_type))
msg = "Plan type of {} changed from {} to {} ".format(realm.name,
get_plan_name(current_plan_type),
get_plan_name(new_plan_type))
context["message"] = msg
new_discount = request.POST.get("discount", None)