mirror of https://github.com/zulip/zulip.git
Revert "settings: Add web-public streams beta subdomain list."
This reverts commit 20368a936c
. It is
no longer in beta, and this configuration is no longer needed.
This commit is contained in:
parent
a6d1c41827
commit
513fcb7bd5
|
@ -297,7 +297,7 @@ def fetch_initial_state_data(
|
||||||
state["server_inline_url_embed_preview"] = settings.INLINE_URL_EMBED_PREVIEW
|
state["server_inline_url_embed_preview"] = settings.INLINE_URL_EMBED_PREVIEW
|
||||||
state["server_avatar_changes_disabled"] = settings.AVATAR_CHANGES_DISABLED
|
state["server_avatar_changes_disabled"] = settings.AVATAR_CHANGES_DISABLED
|
||||||
state["server_name_changes_disabled"] = settings.NAME_CHANGES_DISABLED
|
state["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_ENABLED
|
||||||
state["giphy_rating_options"] = realm.GIPHY_RATING_OPTIONS
|
state["giphy_rating_options"] = realm.GIPHY_RATING_OPTIONS
|
||||||
|
|
||||||
state["server_needs_upgrade"] = is_outdated_server(user_profile)
|
state["server_needs_upgrade"] = is_outdated_server(user_profile)
|
||||||
|
|
|
@ -941,22 +941,13 @@ class Realm(models.Model):
|
||||||
def presence_disabled(self) -> bool:
|
def presence_disabled(self) -> bool:
|
||||||
return self.is_zephyr_mirror_realm
|
return self.is_zephyr_mirror_realm
|
||||||
|
|
||||||
def web_public_streams_available_for_realm(self) -> bool:
|
def web_public_streams_enabled(self) -> bool:
|
||||||
if self.string_id in settings.WEB_PUBLIC_STREAMS_BETA_SUBDOMAINS:
|
|
||||||
return True
|
|
||||||
|
|
||||||
if not settings.WEB_PUBLIC_STREAMS_ENABLED:
|
if not settings.WEB_PUBLIC_STREAMS_ENABLED:
|
||||||
# To help protect against accidentally web-public streams in
|
# To help protect against accidentally web-public streams in
|
||||||
# self-hosted servers, we require the feature to be enabled at
|
# self-hosted servers, we require the feature to be enabled at
|
||||||
# the server level before it is available to users.
|
# the server level before it is available to users.
|
||||||
return False
|
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:
|
if self.plan_type == Realm.PLAN_TYPE_LIMITED:
|
||||||
# In Zulip Cloud, we also require a paid or sponsored
|
# In Zulip Cloud, we also require a paid or sponsored
|
||||||
# plan, to protect against the spam/abuse attacks that
|
# plan, to protect against the spam/abuse attacks that
|
||||||
|
|
|
@ -849,10 +849,6 @@ class RealmTest(ZulipTestCase):
|
||||||
self.assertEqual(realm.has_web_public_streams(), False)
|
self.assertEqual(realm.has_web_public_streams(), False)
|
||||||
self.assertEqual(realm.web_public_streams_enabled(), 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 = False
|
realm.enable_spectator_access = False
|
||||||
realm.save()
|
realm.save()
|
||||||
self.assertEqual(realm.has_web_public_streams(), False)
|
self.assertEqual(realm.has_web_public_streams(), False)
|
||||||
|
|
|
@ -261,8 +261,6 @@ OPEN_REALM_CREATION = False
|
||||||
|
|
||||||
# Whether it's possible to create web-public streams on this server.
|
# Whether it's possible to create web-public streams on this server.
|
||||||
WEB_PUBLIC_STREAMS_ENABLED = False
|
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
|
# Setting for where the system bot users are. Likely has no
|
||||||
# purpose now that the REALMS_HAVE_SUBDOMAINS migration is finished.
|
# purpose now that the REALMS_HAVE_SUBDOMAINS migration is finished.
|
||||||
|
|
Loading…
Reference in New Issue