Make built-in bots come from settings.py, and allow localserver-specific ones

(imported from commit e21933e37487314ac986147562817a19227e8960)
This commit is contained in:
Leo Franchi
2013-10-31 13:33:19 -04:00
parent 4a29f1002d
commit db6550e99a
10 changed files with 68 additions and 34 deletions

View File

@@ -1,5 +1,7 @@
from __future__ import absolute_import
from django.conf import settings
from diff_match_patch import diff_match_patch
import platform
import logging
@@ -107,9 +109,10 @@ def highlight_html_differences(s1, s2):
# We probably want more information here
logging.getLogger('').error('HTML diff produced mal-formed HTML')
subject = "HTML diff failure on %s" % (platform.node(),)
internal_send_message("error-bot@zulip.com", "stream",
"errors", subject, "HTML diff produced malformed HTML")
if settings.ERROR_BOT is not None:
subject = "HTML diff failure on %s" % (platform.node(),)
internal_send_message(settings.ERROR_BOT, "stream",
"errors", subject, "HTML diff produced malformed HTML")
return s2
return retval