email: Remove special integration doc behavior when gateway not set.

The current code looks like it's trying to redirect /integrations/doc/email
to /integrations when EMAIL_GATEWAY_PATTERN is not set.

I think it doesn't currently do this. The test for that pathway has a bug:
self.get_doc('integrations/doc-html/email', subdomain='zulip') needs a
leading slash, and putting the slash back in results in the test failing.

This redirection is not really desired behavior -- better is to
unconditionally show that the email integration exists, and just point the
user to https://zulip.readthedocs.io/en/latest/production/email-gateway.html
(this is done in a child commit).
This commit is contained in:
Rishi Gupta
2019-08-03 18:08:29 -07:00
committed by Tim Abbott
parent 68dd8e4ec8
commit 8167b5b645
5 changed files with 4 additions and 31 deletions

View File

@@ -10,7 +10,7 @@ import random
import re
from zerver.lib.integrations import CATEGORIES, INTEGRATIONS, HubotIntegration, \
WebhookIntegration, EmailIntegration
WebhookIntegration
from zerver.lib.request import has_request_variables, REQ
from zerver.lib.subdomains import get_subdomain
from zerver.models import Realm
@@ -193,9 +193,6 @@ def integration_doc(request: HttpRequest, integration_name: str=REQ(default=None
context['integration_url'] = integration.url[3:]
if isinstance(integration, HubotIntegration):
context['hubot_docs_url'] = integration.hubot_docs_url
if isinstance(integration, EmailIntegration):
context['email_gateway_example'] = settings.EMAIL_GATEWAY_EXAMPLE
context['email_gateway_example_with_options'] = settings.EMAIL_GATEWAY_EXAMPLE_WITH_OPTIONS
doc_html_str = render_markdown_path(integration.doc, context)