mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
zerver/views/webhooks/github.py: Make exception string str.
Passing a unicode string to Exception can sometimes fail. Convert it to str to prevent that.
This commit is contained in:
committed by
Tim Abbott
parent
a32f83b182
commit
85cb3e6103
@@ -9,6 +9,8 @@ import logging
|
|||||||
import re
|
import re
|
||||||
import ujson
|
import ujson
|
||||||
|
|
||||||
|
from zerver.lib.str_utils import force_str
|
||||||
|
|
||||||
COMMITS_IN_LIST_LIMIT = 10
|
COMMITS_IN_LIST_LIMIT = 10
|
||||||
ZULIP_TEST_REPO_NAME = 'zulip-test'
|
ZULIP_TEST_REPO_NAME = 'zulip-test'
|
||||||
ZULIP_TEST_REPO_ID = 6893087
|
ZULIP_TEST_REPO_ID = 6893087
|
||||||
@@ -118,7 +120,7 @@ def api_github_v2(user_profile, event, payload, branches, default_stream, commit
|
|||||||
content += u'\n\n~~~ quote\n%s\n~~~' % (comment['body'],)
|
content += u'\n\n~~~ quote\n%s\n~~~' % (comment['body'],)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise UnknownEventType(u'Event %s is unknown and cannot be handled' % (event,))
|
raise UnknownEventType(force_str(u'Event %s is unknown and cannot be handled' % (event,)))
|
||||||
|
|
||||||
return target_stream, subject, content
|
return target_stream, subject, content
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user