From 060f08e7f7d01418443e85bc0cdb697785f12278 Mon Sep 17 00:00:00 2001 From: Longze Chen Date: Mon, 5 Feb 2024 10:10:22 -0500 Subject: [PATCH] Use instead of to avoid confusion --- api/files/serializers.py | 2 +- api/files/urls.py | 2 +- api/files/views.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/files/serializers.py b/api/files/serializers.py index 2de8a067027..3e2569f9693 100644 --- a/api/files/serializers.py +++ b/api/files/serializers.py @@ -402,7 +402,7 @@ class FileSerializer(BaseFileSerializer): cedar_metadata_records = RelationshipField( related_view='files:file-cedar-metadata-records-list', - related_view_kwargs={'file_id': 'get_file_guid_or_error'}, + related_view_kwargs={'file_guid': 'get_file_guid_or_error'}, ) def get_target_type(self, obj): diff --git a/api/files/urls.py b/api/files/urls.py index 0266e9c2750..3cc32c8f516 100644 --- a/api/files/urls.py +++ b/api/files/urls.py @@ -6,7 +6,7 @@ urlpatterns = [ re_path(r'^(?P\w+)/$', views.FileDetail.as_view(), name=views.FileDetail.view_name), - re_path(r'^(?P\w+)/cedar_metadata_records/$', views.FileCedarMetadataRecordsList.as_view(), name=views.FileCedarMetadataRecordsList.view_name), + re_path(r'^(?P\w+)/cedar_metadata_records/$', views.FileCedarMetadataRecordsList.as_view(), name=views.FileCedarMetadataRecordsList.view_name), re_path(r'^(?P\w+)/versions/$', views.FileVersionsList.as_view(), name=views.FileVersionsList.view_name), re_path(r'^(?P\w+)/versions/(?P\w+)/$', views.FileVersionDetail.as_view(), name=views.FileVersionDetail.view_name), ] diff --git a/api/files/views.py b/api/files/views.py index cbb8e421659..dd084748c84 100644 --- a/api/files/views.py +++ b/api/files/views.py @@ -193,7 +193,7 @@ class FileCedarMetadataRecordsList(JSONAPIBaseView, generics.ListAPIView, ListFi view_name = 'file-cedar-metadata-records-list' def get_default_queryset(self): - return CedarMetadataRecord.objects.filter(guid___id=self.kwargs['file_id']) + return CedarMetadataRecord.objects.filter(guid___id=self.kwargs['file_guid']) def get_queryset(self): return self.get_queryset_from_request()