Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Add trailing slashes to URL conf paths (#801)
Dhruv Bhanushali3c9a1205f07f
diff --git a/api/catalog/api/views/oauth2_views.py b/api/catalog/api/views/oauth2_views.pyindex 45990451c..580dfb7f1 100644--- a/api/catalog/api/views/oauth2_views.py+++ b/api/catalog/api/views/oauth2_views.py@@ -68,7 +68,7 @@ curl \\-X POST \\-H "Content-Type: application/json" \\-d '{"name": "My amazing project", "description": "To access Openverse API", "email": "[email protected]"}' \\- https://api.openverse.engineering/v1/auth_tokens/register+ https://api.openverse.engineering/v1/auth_tokens/register/""" # noqa: E501register_api_oauth2_request = openapi.Schema(@@ -241,7 +241,7 @@ You can use this endpoint to get information about your API key such askey_info_bash = """curl \\-H "Authorization: Bearer DLBYIcfnKfolaXKcmMC8RIDCavc2hW" \\- http://api.openverse.engineering/v1/rate_limit+ http://api.openverse.engineering/v1/rate_limit/"""@swagger_auto_schema(diff --git a/api/catalog/urls/__init__.py b/api/catalog/urls/__init__.pyindex 0faf1676c..b3c44e0a8 100644--- a/api/catalog/urls/__init__.py+++ b/api/catalog/urls/__init__.py@@ -35,7 +35,7 @@ discontinuation_message = {}versioned_paths = [- path("rate_limit", CheckRates.as_view(), name="key_info"),+ path("rate_limit/", CheckRates.as_view(), name="key_info"),path("auth_tokens/", include(auth_tokens_patterns)),# Deprecated, redirects to new URLpath(diff --git a/api/catalog/urls/auth_tokens.py b/api/catalog/urls/auth_tokens.pyindex a6b586c07..3631bbc4d 100644--- a/api/catalog/urls/auth_tokens.py+++ b/api/catalog/urls/auth_tokens.py@@ -4,7 +4,7 @@ from catalog.api.views.oauth2_views import Register, VerifyEmailurlpatterns = [- path("register", Register.as_view(), name="register"),+ path("register/", Register.as_view(), name="register"),path("verify/<str:code>", VerifyEmail.as_view(), name="verify-email"),path("", include("oauth2_provider.urls", namespace="oauth2_provider")),]diff --git a/api/test/api_live_integration.py b/api/test/api_live_integration.pyindex c5b88235a..70c31140b 100644--- a/api/test/api_live_integration.py+++ b/api/test/api_live_integration.py@@ -228,7 +228,7 @@ def test_oauth2_registration():"description": "A key for testing the OAuth2 registration process.","email": "[email protected]",}- response = requests.post(f"{API_URL}/oauth2/register", json=payload, verify=False)+ response = requests.post(f"{API_URL}/oauth2/register/", json=payload, verify=False)parsed_response = json.loads(response.text)assert response.status_code == 201return parsed_responsediff --git a/api/test/auth_test.py b/api/test/auth_test.pyindex 37aac9579..e6e308eed 100644--- a/api/test/auth_test.py+++ b/api/test/auth_test.py@@ -19,7 +19,7 @@ def test_auth_tokens_registration(client):"email": "[email protected]",}res = client.post(- "/v1/auth_tokens/register",+ "/v1/auth_tokens/register/",data,verify=False,)@@ -70,7 +70,7 @@ def test_auth_rate_limit_reporting(client, test_auth_token_exchange, verified=Fa# the token.time.sleep(1)token = test_auth_token_exchange["access_token"]- res = client.get("/v1/rate_limit", HTTP_AUTHORIZATION=f"Bearer {token}")+ res = client.get("/v1/rate_limit/", HTTP_AUTHORIZATION=f"Bearer {token}")res_data = res.json()if verified:assert res_data["rate_limit_model"] == "standard"