Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
Revert "settings: Add web-public streams beta subdomain list."
Alex Vandiver513fcb7bd51e
diff --git a/zerver/lib/events.py b/zerver/lib/events.pyindex 01b3ddcfe51..1ee558749ee 100644--- a/zerver/lib/events.py+++ b/zerver/lib/events.py@@ -297,7 +297,7 @@ def fetch_initial_state_data(state["server_inline_url_embed_preview"] = settings.INLINE_URL_EMBED_PREVIEWstate["server_avatar_changes_disabled"] = settings.AVATAR_CHANGES_DISABLEDstate["server_name_changes_disabled"] = settings.NAME_CHANGES_DISABLED- state["server_web_public_streams_enabled"] = realm.web_public_streams_available_for_realm()+ state["server_web_public_streams_enabled"] = settings.WEB_PUBLIC_STREAMS_ENABLEDstate["giphy_rating_options"] = realm.GIPHY_RATING_OPTIONSstate["server_needs_upgrade"] = is_outdated_server(user_profile)diff --git a/zerver/models.py b/zerver/models.pyindex 2ff84b231b9..158c53fe6c6 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -941,22 +941,13 @@ class Realm(models.Model):def presence_disabled(self) -> bool:return self.is_zephyr_mirror_realm- def web_public_streams_available_for_realm(self) -> bool:- if self.string_id in settings.WEB_PUBLIC_STREAMS_BETA_SUBDOMAINS:- return True-+ def web_public_streams_enabled(self) -> bool:if not settings.WEB_PUBLIC_STREAMS_ENABLED:# To help protect against accidentally web-public streams in# self-hosted servers, we require the feature to be enabled at# the server level before it is available to users.return False- return True-- def web_public_streams_enabled(self) -> bool:- if not self.web_public_streams_available_for_realm():- return False-if self.plan_type == Realm.PLAN_TYPE_LIMITED:# In Zulip Cloud, we also require a paid or sponsored# plan, to protect against the spam/abuse attacks thatdiff --git a/zerver/tests/test_realm.py b/zerver/tests/test_realm.pyindex ee94d143db0..3eaf532a2c2 100644--- a/zerver/tests/test_realm.py+++ b/zerver/tests/test_realm.py@@ -849,10 +849,6 @@ class RealmTest(ZulipTestCase):self.assertEqual(realm.has_web_public_streams(), False)self.assertEqual(realm.web_public_streams_enabled(), False)- with self.settings(WEB_PUBLIC_STREAMS_BETA_SUBDOMAINS=["zulip"]):- self.assertEqual(realm.has_web_public_streams(), True)- self.assertEqual(realm.web_public_streams_enabled(), True)-realm.enable_spectator_access = Falserealm.save()self.assertEqual(realm.has_web_public_streams(), False)diff --git a/zproject/default_settings.py b/zproject/default_settings.pyindex 36d206d4966..86a7f80b6cb 100644--- a/zproject/default_settings.py+++ b/zproject/default_settings.py@@ -261,8 +261,6 @@ OPEN_REALM_CREATION = False# Whether it's possible to create web-public streams on this server.WEB_PUBLIC_STREAMS_ENABLED = False-# Temporary setting during web-public streams beta.-WEB_PUBLIC_STREAMS_BETA_SUBDOMAINS: List[str] = []# Setting for where the system bot users are. Likely has no# purpose now that the REALMS_HAVE_SUBDOMAINS migration is finished.