Re-enable markup for CUSTOMER1

(imported from commit 3d74260796c85216d71d8261020cc149e0b6ce1c)
This commit is contained in:
Keegan McAllister 2013-02-01 18:56:37 -05:00
parent 04d31a12eb
commit 2a556fd002

View File

@ -172,6 +172,7 @@ def get_stream(stream_name, realm):
except Stream.DoesNotExist:
return None
# NB: This function is currently unused, but may come in handy.
def linebreak(string):
return string.replace('\n\n', '<p/>').replace('\n', '<br/>')
@ -222,11 +223,7 @@ class Message(models.Model):
gravatar_hash = gravatar_hash(self.sender.user.email))
if apply_markdown:
if (self.sender.realm.domain != "customer1.invalid" or
self.sending_client.name in ('API', 'github_bot')):
obj['content'] = bugdown.convert(self.content)
else:
obj['content'] = linebreak(escape(self.content))
obj['content'] = bugdown.convert(self.content)
obj['content_type'] = 'text/html'
else:
obj['content'] = self.content