diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index 770edde42f..e8e230050e 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -171,8 +171,10 @@ class DocPageTest(ZulipTestCase): class HelpTest(ZulipTestCase): def test_help_settings_links(self) -> None: result = self.client_get('/help/change-the-time-format') - self.assertIn('Go to Display settings', str(result.content)) self.assertEqual(result.status_code, 200) + self.assertIn('Go to Display settings', str(result.content)) + # Check that the sidebar was rendered properly. + self.assertIn('Getting started with Zulip', str(result.content)) with self.settings(ROOT_DOMAIN_LANDING_PAGE=True): result = self.client_get('/help/change-the-time-format', subdomain="") diff --git a/zerver/views/integrations.py b/zerver/views/integrations.py index 836e05beb2..db107d320e 100644 --- a/zerver/views/integrations.py +++ b/zerver/views/integrations.py @@ -71,9 +71,10 @@ class MarkdownDirectoryView(ApiURLView): elif "/" in article: article = "missing" http_status = 404 - if len(article) > 100 or not re.match('^[0-9a-zA-Z_-]+$', article): + elif len(article) > 100 or not re.match('^[0-9a-zA-Z_-]+$', article): article = "missing" http_status = 404 + path = self.path_template % (article,) try: loader.get_template(path)