Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
decorator: Rename internal_notify_view.
Alex Vandiverab683fac2914
diff --git a/zerver/decorator.py b/zerver/decorator.pyindex 67c20a780a6..8a2932ec7e4 100644--- a/zerver/decorator.py+++ b/zerver/decorator.py@@ -927,7 +927,7 @@ def authenticate_internal_api(request: HttpRequest, secret: str = REQ("secret")))-def internal_notify_view(+def internal_api_view(is_tornado_view: bool,) -> Callable[[Callable[Concatenate[HttpRequest, ParamT], HttpResponse]],diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.pyindex e9a333a7e4d..e61680a8d23 100644--- a/zerver/tests/test_decorators.py+++ b/zerver/tests/test_decorators.py@@ -23,7 +23,7 @@ from zerver.decorator import (authenticated_json_view,authenticated_rest_api_view,authenticated_uploads_api_view,- internal_notify_view,+ internal_api_view,process_client,public_json_view,return_success_on_head_request,@@ -995,7 +995,7 @@ class TestInternalNotifyView(ZulipTestCase):def internal_notify(self, is_tornado: bool, req: HttpRequest) -> HttpResponse:boring_view = lambda req: json_response(msg=self.BORING_RESULT)- return internal_notify_view(is_tornado)(boring_view)(req)+ return internal_api_view(is_tornado)(boring_view)(req)def test_valid_internal_requests(self) -> None:secret = "random"diff --git a/zerver/tornado/views.py b/zerver/tornado/views.pyindex e9659796a2b..8ca6385f95c 100644--- a/zerver/tornado/views.py+++ b/zerver/tornado/views.py@@ -7,7 +7,7 @@ from django.http import HttpRequest, HttpResponsefrom django.utils.translation import gettext as _from typing_extensions import ParamSpec-from zerver.decorator import internal_notify_view, process_client+from zerver.decorator import internal_api_view, process_clientfrom zerver.lib.exceptions import JsonableErrorfrom zerver.lib.queue import get_queue_clientfrom zerver.lib.request import REQ, RequestNotes, has_request_variables@@ -38,7 +38,7 @@ def in_tornado_thread(f: Callable[P, T]) -> Callable[P, T]:return async_to_sync(wrapped)-@internal_notify_view(True)+@internal_api_view(True)@has_request_variablesdef notify(request: HttpRequest, data: Mapping[str, Any] = REQ(json_validator=check_dict([]))@@ -79,7 +79,7 @@ def cleanup_event_queue(return json_success(request)-@internal_notify_view(True)+@internal_api_view(True)@has_request_variablesdef get_events_internal(request: HttpRequest, user_profile_id: int = REQ(json_validator=check_int)diff --git a/zerver/views/email_mirror.py b/zerver/views/email_mirror.pyindex 65cb7b9fb80..732fcf4fcb8 100644--- a/zerver/views/email_mirror.py+++ b/zerver/views/email_mirror.py@@ -1,13 +1,13 @@from django.http import HttpRequest, HttpResponse-from zerver.decorator import internal_notify_view+from zerver.decorator import internal_api_viewfrom zerver.lib.email_mirror import mirror_email_messagefrom zerver.lib.exceptions import JsonableErrorfrom zerver.lib.request import REQ, has_request_variablesfrom zerver.lib.response import json_success-@internal_notify_view(False)+@internal_api_view(False)@has_request_variablesdef email_mirror_message(request: HttpRequest,