diff --git a/ietf/api/tests.py b/ietf/api/tests.py index 2310d71d75..dca70a8152 100644 --- a/ietf/api/tests.py +++ b/ietf/api/tests.py @@ -901,7 +901,7 @@ def test_api_get_session_matherials_no_agenda_meeting_url(self): r = self.client.get(url) self.assertEqual(r.status_code, 200) - @override_settings(APP_API_TOKENS={"ietf.api.views.email_aliases": ["valid-token"]}) + @override_settings(APP_API_TOKENS={"ietf.api.views.draft_aliases": ["valid-token"]}) @mock.patch("ietf.api.views.DraftAliasGenerator") def test_draft_aliases(self, mock): mock.return_value = (("alias1", ("a1", "a2")), ("alias2", ("a3", "a4"))) @@ -935,7 +935,7 @@ def test_draft_aliases(self, mock): 405, ) - @override_settings(APP_API_TOKENS={"ietf.api.views.email_aliases": ["valid-token"]}) + @override_settings(APP_API_TOKENS={"ietf.api.views.group_aliases": ["valid-token"]}) @mock.patch("ietf.api.views.GroupAliasGenerator") def test_group_aliases(self, mock): mock.return_value = (("alias1", ("ietf",), ("a1", "a2")), ("alias2", ("ietf", "iab"), ("a3", "a4"))) diff --git a/ietf/api/views.py b/ietf/api/views.py index 744c6548ae..6541fce0ad 100644 --- a/ietf/api/views.py +++ b/ietf/api/views.py @@ -452,7 +452,7 @@ def directauth(request): return HttpResponse(status=405) -@requires_api_token("ietf.api.views.email_aliases") +@requires_api_token @csrf_exempt def draft_aliases(request): if request.method == "GET": @@ -471,7 +471,7 @@ def draft_aliases(request): return HttpResponse(status=405) -@requires_api_token("ietf.api.views.email_aliases") +@requires_api_token @csrf_exempt def group_aliases(request): if request.method == "GET":