Skip to content

Commit

Permalink
support: Update success message for plan type change.
Browse files Browse the repository at this point in the history
  • Loading branch information
rishig authored and timabbott committed May 8, 2019
1 parent 42c37ef commit 0218da6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion analytics/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def test_change_plan_type(self) -> None:
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")
Expand Down
5 changes: 3 additions & 2 deletions analytics/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0218da6

Please sign in to comment.