mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +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,
|
||||
payload: Dict[str, Any]=REQ(argument_type='body'),
|
||||
stream: str=REQ(default='test')) -> HttpResponse:
|
||||
topic, body = topic_and_body(payload)
|
||||
try:
|
||||
check_send_webhook_message(request, user_profile, topic, body)
|
||||
topic, body = topic_and_body(payload)
|
||||
except NotImplementedEventType: # nocoverage
|
||||
pass
|
||||
except SuppressedEvent: # nocoverage
|
||||
pass
|
||||
check_send_webhook_message(request, user_profile, topic, body)
|
||||
return json_success()
|
||||
|
||||
def topic_and_body(payload: Dict[str, Any]) -> Tuple[str, str]:
|
||||
|
||||
Reference in New Issue
Block a user