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.

portico: Stop listing deactivated organizations in the directory.

Prakhar Pratyush432ab937aa59
diff --git a/corporate/views/portico.py b/corporate/views/portico.py
index 4687fb11151..2e75949ba8f 100644
--- a/corporate/views/portico.py
+++ b/corporate/views/portico.py
@@ -341,6 +341,10 @@ def communities_view(request: HttpRequest) -> HttpResponse:
# Filter out demo organizations.
demo_organization_scheduled_deletion_date__isnull=False,
)
+ .exclude(
+ # Filter out deactivated organizations.
+ deactivated=True,
+ )
.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 dc24341727a..b15d3cc0234 100644
--- a/zerver/tests/test_docs.py
+++ b/zerver/tests/test_docs.py
@@ -389,6 +389,17 @@ class DocPageTest(ZulipTestCase):
["Zulip Dev", "Some description", 'data-category="research"'], result
)
+ # Reset
+ realm.demo_organization_scheduled_deletion_date = None
+ realm.save(update_fields=["demo_organization_scheduled_deletion_date"])
+ self._test("/communities/", ["Open communities directory", "Zulip Dev", "Some description"])
+
+ # Deactivated organizations are not shown.
+ realm.deactivated = True
+ realm.save(update_fields=["deactivated"])
+ result = self.client_get("/communities/")
+ self.assert_not_in_success_response(["Zulip Dev"], result)
+
def test_integration_doc_endpoints(self) -> None:
images_in_docs = set()