From ebe3acf408fa8242ec6fe9e2fcb21d4ecb186f1e Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Fri, 22 Nov 2013 10:40:34 -0500 Subject: [PATCH] Generalize elide_subject in case the max topic length changes. (imported from commit 6ffdd42d39580149a83869d6aff88bad8940fe02) --- zerver/views/webhooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/views/webhooks.py b/zerver/views/webhooks.py index c658012d86..30798ff555 100644 --- a/zerver/views/webhooks.py +++ b/zerver/views/webhooks.py @@ -198,7 +198,7 @@ def build_message_from_gitlog(user_profile, name, ref, commits, before, after, u def elide_subject(subject): if len(subject) > MAX_SUBJECT_LENGTH: - subject = subject[:57].rstrip() + '...' + subject = subject[:MAX_SUBJECT_LENGTH - 3].rstrip() + '...' return subject def guess_zulip_user_from_jira(jira_username, realm):