Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

demo-orgs: Filter demos from eligible community directory realms.

Lauryn Menard0410ab95bbad
diff --git a/corporate/views/portico.py b/corporate/views/portico.py
index 8c4c12dd7b7..a2bb4d6c30f 100644
--- a/corporate/views/portico.py
+++ b/corporate/views/portico.py
@@ -337,6 +337,10 @@ def communities_view(request: HttpRequest) -> HttpResponse:
# Filter out realms who haven't changed their description from the default.
description="",
)
+ .exclude(
+ # Filter out demo organizations.
+ demo_organization_scheduled_deletion_date__isnull=False,
+ )
.order_by("name")
)
for realm in want_to_be_advertised_realms:
diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py
index 52c3c9f85eb..17b3f588724 100644
--- a/zerver/tests/test_docs.py
+++ b/zerver/tests/test_docs.py
@@ -1,6 +1,7 @@
import os
import re
from collections.abc import Sequence
+from datetime import timedelta
from typing import TYPE_CHECKING, Any
from unittest import mock, skipUnless
from urllib.parse import urlsplit
@@ -379,6 +380,15 @@ class DocPageTest(ZulipTestCase):
"/communities/", ["Open communities directory", "Zulip Dev", 'data-category="research"']
)
+ # Demo organizations are not shown.
+ demo_deletion_date = timezone_now() + timedelta(days=15)
+ realm.demo_organization_scheduled_deletion_date = demo_deletion_date
+ realm.save()
+ result = self.client_get("/communities/")
+ self.assert_not_in_success_response(
+ ["Zulip Dev", "Some description", 'data-category="research"'], result
+ )
+
def test_integration_doc_endpoints(self) -> None:
images_in_docs = set()