integrations: Fix missing links to non-webhook integrations.

Apparently help_content was attached to the wrong class.

Fixes #4744.
This commit is contained in:
Tim Abbott
2017-05-10 11:17:53 -07:00
parent 232592cc9f
commit 248785e66e

View File

@@ -59,6 +59,17 @@ class Integration(object):
# type: (Dict[Any, Any]) -> None
self.doc_context = context
@property
def help_content(self):
# type: () -> Text
doc_context = self.doc_context or {}
if self.doc.endswith('.md'):
return render_markdown_path(self.doc, doc_context)
else:
template = loader.get_template(self.doc)
return mark_safe(template.render(doc_context))
class EmailIntegration(Integration):
def is_enabled(self):
# type: () -> bool
@@ -104,17 +115,6 @@ class WebhookIntegration(Integration):
# type: () -> LocaleRegexProvider
return url(self.url, self.function)
@property
def help_content(self):
# type: () -> Text
doc_context = self.doc_context or {}
if self.doc.endswith('.md'):
return render_markdown_path(self.doc, doc_context)
else:
template = loader.get_template(self.doc)
return mark_safe(template.render(doc_context))
class HubotLozenge(Integration):
GIT_URL_TEMPLATE = "https://github.com/hubot-scripts/hubot-{}"