From e7746809d2aa0dc2a4a222f64dc8a40639a9fff3 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 13 Dec 2018 10:22:19 -0800 Subject: [PATCH] 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. --- zerver/webhooks/stripe/view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/webhooks/stripe/view.py b/zerver/webhooks/stripe/view.py index 9299a89382..43b7082e51 100644 --- a/zerver/webhooks/stripe/view.py +++ b/zerver/webhooks/stripe/view.py @@ -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]: