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

@@ -1,7 +1,6 @@
import os
from typing import Dict, List, Optional, Any
from django.conf import settings
from django.conf.urls import url
from django.contrib.staticfiles.storage import staticfiles_storage
from django.urls.resolvers import LocaleRegexProvider
@@ -128,10 +127,6 @@ class BotIntegration(Integration):
doc = self.DEFAULT_DOC_PATH.format(name=name)
self.doc = doc
class EmailIntegration(Integration):
def is_enabled(self) -> bool:
return settings.EMAIL_GATEWAY_PATTERN != ""
class WebhookIntegration(Integration):
DEFAULT_FUNCTION_PATH = 'zerver.webhooks.{name}.view.api_{name}_webhook'
DEFAULT_URL = 'api/v1/external/{name}'
@@ -354,8 +349,8 @@ INTEGRATIONS = {
doc='zerver/integrations/codebase.md'),
'discourse': Integration('discourse', 'discourse', ['communication'],
doc='zerver/integrations/discourse.md'),
'email': EmailIntegration('email', 'email', ['communication'],
doc='zerver/integrations/email.md'),
'email': Integration('email', 'email', ['communication'],
doc='zerver/integrations/email.md'),
'errbot': Integration('errbot', 'errbot', ['meta-integration', 'bots'],
doc='zerver/integrations/errbot.md'),
'git': Integration('git', 'git', ['version-control'],