Skip to content

Commit

Permalink
support: Rename deactive to deactivated.
Browse files Browse the repository at this point in the history
  • Loading branch information
rishig authored and timabbott committed May 8, 2019
1 parent d2b3274 commit 98da11c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions analytics/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def check_zulip_realm_result(result: HttpResponse) -> None:
'<option value="2" >Limited</option>',
'input type="number" name="discount" value="None"',
'<option value="active" selected>Active</option>',
'<option value="deactive" >Deactive</option>',
'<option value="deactivated" >Deactivated</option>',
'scrub-realm-button">',
'data-string-id="zulip"'], result)

Expand All @@ -351,7 +351,7 @@ def check_lear_realm_result(result: HttpResponse) -> None:
'<option value="2" >Limited</option>',
'input type="number" name="discount" value="None"',
'<option value="active" selected>Active</option>',
'<option value="deactive" >Deactive</option>',
'<option value="deactivated" >Deactivated</option>',
'scrub-realm-button">',
'data-string-id="lear"'], result)

Expand Down Expand Up @@ -428,15 +428,15 @@ def test_activate_or_deactivate_realm(self) -> None:
cordelia_email = self.example_email("cordelia")
self.login(cordelia_email)

result = self.client_post("/activity/support", {"realm_id": "3", "status": "deactive"})
result = self.client_post("/activity/support", {"realm_id": "3", "status": "deactivated"})
self.assertEqual(result.status_code, 302)
self.assertEqual(result["Location"], "/login/")

iago_email = self.example_email("iago")
self.login(iago_email)

with mock.patch("analytics.views.do_deactivate_realm") as m:
result = self.client_post("/activity/support", {"realm_id": "3", "status": "deactive"})
result = self.client_post("/activity/support", {"realm_id": "3", "status": "deactivated"})
m.assert_called_once_with(get_realm("lear"))
self.assert_in_success_response(["Lear &amp; Co. deactivated"], result)

Expand Down
2 changes: 1 addition & 1 deletion analytics/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ def support(request: HttpRequest) -> HttpResponse:
if status == "active":
do_reactivate_realm(realm)
context["message"] = "{} reactivated.".format(realm.name)
elif status == "deactive":
elif status == "deactivated":
do_deactivate_realm(realm)
context["message"] = "{} deactivated.".format(realm.name)

Expand Down
4 changes: 2 additions & 2 deletions templates/analytics/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h3><img src="{{ user.realm.realm_icon_url }}" class="support-realm-icon"> {{ us
<input type="hidden" name="realm_id" value="{{ user.realm.id }}" />
<select name="status">
<option value="active" {% if not user.realm.deactivated %}selected{% endif %}>Active</option>
<option value="deactive" {% if user.realm.deactivated %}selected{% endif %}>Deactive</option>
<option value="deactivated" {% if user.realm.deactivated %}selected{% endif %}>Deactivated</option>
</select>
<button type="submit" class="button rounded small support-submit-button">Update</button>
</form>
Expand Down Expand Up @@ -100,7 +100,7 @@ <h3><img src="{{ realm.realm_icon_url }}" class="support-realm-icon"> {{ realm.n
<input type="hidden" name="realm_id" value="{{ realm.id }}" />
<select name="status">
<option value="active" {% if not realm.deactivated %}selected{% endif %}>Active</option>
<option value="deactive" {% if realm.deactivated %}selected{% endif %}>Deactive</option>
<option value="deactivated" {% if realm.deactivated %}selected{% endif %}>Deactivated</option>
</select>
<button type="submit" class="button rounded small support-submit-button">Update</button>
</form>
Expand Down
2 changes: 1 addition & 1 deletion zerver/tests/test_realm.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_do_deactivate_realm_clears_scheduled_jobs(self) -> None:
do_deactivate_realm(user.realm)
self.assertEqual(ScheduledEmail.objects.count(), 0)

def test_do_deactivate_realm_on_deactived_realm(self) -> None:
def test_do_deactivate_realm_on_deactivated_realm(self) -> None:
"""Ensure early exit is working in realm deactivation"""
realm = get_realm('zulip')
self.assertFalse(realm.deactivated)
Expand Down

0 comments on commit 98da11c

Please sign in to comment.