From 43c8f00d52f8ec78ccc7565a6b657c229cf29f88 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Tue, 28 Nov 2023 12:46:51 -0600 Subject: [PATCH] Expect list endpoints to be called -list Signed-off-by: Rick Elrod --- ansible_base/models/common.py | 2 +- ansible_base/urls.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible_base/models/common.py b/ansible_base/models/common.py index a14419e85..070c2b8d9 100644 --- a/ansible_base/models/common.py +++ b/ansible_base/models/common.py @@ -96,7 +96,7 @@ def related_fields(self, request): # Add any reverse relations required for field in getattr(self, 'reverse_foreign_key_fields', []): - reverse_view = f"{underscore(self.__class__.__name__)}-{field}" + reverse_view = f"{underscore(self.__class__.__name__)}-{field}-list" response[field] = reverse(reverse_view, kwargs={'pk': self.pk}) return response diff --git a/ansible_base/urls.py b/ansible_base/urls.py index 5b86875d0..067bfbaa6 100644 --- a/ansible_base/urls.py +++ b/ansible_base/urls.py @@ -28,7 +28,7 @@ re_path( r'authenticators/(?P[0-9]+)/authenticator_maps/$', views.AuthenticatorAuthenticatorMapViewSet.as_view(view_only_list), - name='authenticator-authenticator-map', + name='authenticator-authenticator-map-list', ), # Maps path('authenticator_maps/', views.AuthenticatorMapViewSet.as_view(list_actions), name='authenticator_map-list'),