webhooks: Move UnexpectedWebhookEventType into zerver.lib.exceptions.

8e10ab282a moved UnexpectedWebhookEventType into
`zerver.lib.exceptions`, but left the import into
`zserver.lib.webhooks.common` so that webhooks could continue to
import the exception from there.

This clutters things and adds complexity; there is no compelling
reason that the exception's source of truth should not move alongside
all other exceptions.
This commit is contained in:
Alex Vandiver
2020-08-19 13:14:40 -07:00
committed by Tim Abbott
parent f95dd628bd
commit 8016769613
28 changed files with 49 additions and 36 deletions

View File

@@ -6,9 +6,10 @@ from typing import Any, Callable, Dict, List, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.exceptions import UnexpectedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import UnexpectedWebhookEventType, check_send_webhook_message
from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.lib.webhooks.git import (
CONTENT_MESSAGE_TEMPLATE,
TOPIC_WITH_BRANCH_TEMPLATE,