Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
management: Rename command reactivate_stream -> unarchive_stream.
David Rosacb123d4f153c
diff --git a/zerver/actions/streams.py b/zerver/actions/streams.pyindex 8ccf1c16eac..09297d521f6 100644--- a/zerver/actions/streams.py+++ b/zerver/actions/streams.py@@ -158,7 +158,7 @@ def deactivated_streams_by_old_name(realm: Realm, stream_name: str) -> QuerySet[@transaction.atomic(savepoint=False)-def do_reactivate_stream(+def do_unarchive_stream(stream: Stream, new_name: str, *, acting_user: Optional[UserProfile]) -> None:realm = stream.realmdiff --git a/zerver/management/commands/reactivate_stream.py b/zerver/management/commands/unarchive_stream.pysimilarity index 97%rename from zerver/management/commands/reactivate_stream.pyrename to zerver/management/commands/unarchive_stream.pyindex 3d33b5bda5d..a9ce682fc2f 100644--- a/zerver/management/commands/reactivate_stream.py+++ b/zerver/management/commands/unarchive_stream.py@@ -3,7 +3,7 @@ from typing import Any, Optionalfrom django.core.management.base import CommandError-from zerver.actions.streams import deactivated_streams_by_old_name, do_reactivate_stream+from zerver.actions.streams import deactivated_streams_by_old_name, do_unarchive_streamfrom zerver.lib.management import ZulipBaseCommandfrom zerver.models import RealmAuditLog, Stream@@ -88,4 +88,4 @@ class Command(ZulipBaseCommand):)assert stream is not None- do_reactivate_stream(stream, new_name, acting_user=None)+ do_unarchive_stream(stream, new_name, acting_user=None)diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.pyindex 714ad613b36..996d5afb79f 100644--- a/zerver/tests/test_subs.py+++ b/zerver/tests/test_subs.py@@ -32,7 +32,7 @@ from zerver.actions.streams import (do_change_stream_group_based_setting,do_change_stream_post_policy,do_deactivate_stream,- do_reactivate_stream,+ do_unarchive_stream,)from zerver.actions.user_groups import add_subgroups_to_user_group, check_add_user_groupfrom zerver.actions.users import do_change_user_role, do_deactivate_user@@ -1444,19 +1444,19 @@ class StreamAdminTest(ZulipTestCase):old_style.save()self.assertEqual(set(deactivated_streams_by_old_name(realm, "old_style")), {old_style})- def test_reactivate_stream_active_stream(self) -> None:+ def test_unarchive_stream_active_stream(self) -> None:stream = self.make_stream("new_stream")with self.assertRaisesRegex(JsonableError, "Stream is not currently deactivated"):- do_reactivate_stream(stream, new_name="new_stream", acting_user=None)+ do_unarchive_stream(stream, new_name="new_stream", acting_user=None)- def test_reactivate_stream_existing_name(self) -> None:+ def test_unarchive_stream_existing_name(self) -> None:stream = self.make_stream("new_stream")self.make_stream("existing")do_deactivate_stream(stream, acting_user=None)with self.assertRaisesRegex(JsonableError, "Stream named existing already exists"):- do_reactivate_stream(stream, new_name="existing", acting_user=None)+ do_unarchive_stream(stream, new_name="existing", acting_user=None)- def test_reactivate_stream(self) -> None:+ def test_unarchive_stream(self) -> None:desdemona = self.example_user("desdemona")iago = self.example_user("iago")hamlet = self.example_user("hamlet")@@ -1467,7 +1467,7 @@ class StreamAdminTest(ZulipTestCase):self.subscribe(cordelia, stream.name)do_deactivate_stream(stream, acting_user=None)with self.capture_send_event_calls(expected_num_events=4) as events:- do_reactivate_stream(stream, new_name="new_stream", acting_user=None)+ do_unarchive_stream(stream, new_name="new_stream", acting_user=None)# Tell all admins and owners that the stream existsself.assertEqual(events[0]["event"]["op"], "create")