webhooks: Rename api_key_only_webhook_view to webhook_view.

There are no other types of webhook views; this is more concise.
This commit is contained in:
Alex Vandiver
2020-08-19 15:32:15 -07:00
committed by Tim Abbott
parent 8cfacbf8aa
commit cf6ebb9c8d
77 changed files with 159 additions and 159 deletions

View File

@@ -4,7 +4,7 @@ from unittest.mock import MagicMock, patch
from django.http import HttpRequest
from zerver.decorator import api_key_only_webhook_view
from zerver.decorator import webhook_view
from zerver.lib.exceptions import InvalidJSONError, JsonableError
from zerver.lib.send_email import FromAddress
from zerver.lib.test_classes import WebhookTestCase, ZulipTestCase
@@ -58,11 +58,11 @@ class WebhooksCommonTestCase(ZulipTestCase):
self.assertEqual(msg.content, expected_message)
def test_notify_bot_owner_on_invalid_json(self) -> None:
@api_key_only_webhook_view('ClientName', notify_bot_owner_on_invalid_json=False)
@webhook_view('ClientName', notify_bot_owner_on_invalid_json=False)
def my_webhook_no_notify(request: HttpRequest, user_profile: UserProfile) -> None:
raise InvalidJSONError("Malformed JSON")
@api_key_only_webhook_view('ClientName', notify_bot_owner_on_invalid_json=True)
@webhook_view('ClientName', notify_bot_owner_on_invalid_json=True)
def my_webhook_notify(request: HttpRequest, user_profile: UserProfile) -> None:
raise InvalidJSONError("Malformed JSON")