mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
stripe: Fix exception handler for suppressed events.
Apparently, we incorrectly placed the try/except block around the common code, not the code that can actually raise these exceptions.
This commit is contained in:
@@ -25,13 +25,13 @@ class SuppressedEvent(Exception):
|
|||||||
def api_stripe_webhook(request: HttpRequest, user_profile: UserProfile,
|
def api_stripe_webhook(request: HttpRequest, user_profile: UserProfile,
|
||||||
payload: Dict[str, Any]=REQ(argument_type='body'),
|
payload: Dict[str, Any]=REQ(argument_type='body'),
|
||||||
stream: str=REQ(default='test')) -> HttpResponse:
|
stream: str=REQ(default='test')) -> HttpResponse:
|
||||||
topic, body = topic_and_body(payload)
|
|
||||||
try:
|
try:
|
||||||
check_send_webhook_message(request, user_profile, topic, body)
|
topic, body = topic_and_body(payload)
|
||||||
except NotImplementedEventType: # nocoverage
|
except NotImplementedEventType: # nocoverage
|
||||||
pass
|
pass
|
||||||
except SuppressedEvent: # nocoverage
|
except SuppressedEvent: # nocoverage
|
||||||
pass
|
pass
|
||||||
|
check_send_webhook_message(request, user_profile, topic, body)
|
||||||
return json_success()
|
return json_success()
|
||||||
|
|
||||||
def topic_and_body(payload: Dict[str, Any]) -> Tuple[str, str]:
|
def topic_and_body(payload: Dict[str, Any]) -> Tuple[str, str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user